GithubHelp home page GithubHelp logo

isabella232 / identity-oidc-expressjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 18f/identity-oidc-expressjs

0.0 0.0 0.0 1.83 MB

An example Login.gov client application which authenticates users via OpenID Connect (OIDC). Built with Node.js, Express.js, and Passport.js.

License: Other

JavaScript 74.52% CSS 0.87% HTML 24.61%

identity-oidc-expressjs's Introduction

This sample SP has been retired. It was used for early prototyping for integrations with login.gov and has not been maintained. It has confirmed vulnerabilities and should not be used for production itegrations.

For maintained examples of integrations with login.gov please refer to:

identity-oidc-expressjs

An example Login.gov client application which authenticates users via OpenID Connect (OIDC). Built with Node.js, Express.js, and Passport.js. Uses the openid-client package, a certified OpenID Relaying Party, to issue authentication requests.

Demo:

a screencast of a user navigating this application: logging in using LOA1 by clicking a button on the homepage, then getting redirected to a profile page showing the user's email address, then logging out and demonstrating inability to access the profile page again. then repeating the process using LOA3 to log-in produces the same results, except it displays more user information on the profile page.

Prerequisites

Install Dependencies

Install Node.js (version 8.9.3), perhaps using NVM to do so.

Install nodemon development server globally:

npm install nodemon -g

Install package dependences:

npm install

Choose a Login.gov Environment

Sandbox Environment

Set the DISCOVERY_URL environment variable to one of the sandbox urls:

  • https://idp.dev.identitysandbox.gov
  • https://idp.int.identitysandbox.gov (untested)

Development Environment (Local Server)

Set the DISCOVERY_URL environment variable to http://localhost:3000.

Run a Login.gov (identity-idp) instance locally on port 3000:

cd path/to/identity-idp

bin/rails s -b 127.0.0.1
bundle exec sidekiq --config config/sidekiq.yml
mailcatcher -f

NOTE: the openid-client package attempts to make various authentication requests to 127.0.0.1:3000, but when the Login.gov instance is running normally on localhost:3000 via the make run command, the openid-client requests won't be able to find it (produces RequestError: connect ECONNREFUSED 127.0.0.1:3000 client errors). So a work-around for this issue is to run the Login.gov instance via the commands listed above. ๐Ÿ˜ƒ

Usage

Run this client application on a local web server:

DEBUG=identity-oidc-expressjs:* npm start # then view localhost:9393 in a browser

License

identity-oidc-expressjs's People

Contributors

dependabot[bot] avatar jmhooper avatar s2t2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.