Skip to content

An example Login.gov client application which authenticates users via OpenID Connect (OIDC). Written in Go. Uses the Gin web framework.

License

Notifications You must be signed in to change notification settings

rossetti-gov/identity-oidc-gin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

identity-oidc-gin

An example Login.gov client application which authenticates users via OpenID Connect (OIDC). Written in Go. Uses the Gin web framework and the Goth authentication package. Disclaimer: Goth is not (yet) a certified OpenID Relaying Party.

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.

Installation

Install Go (version 1.9.4).

Install the source code:

go get github.com/18F/identity-oidc-gin
cd $GOPATH/src/github.com/18F/identity-oidc-gin

Configuration

Configure environment variables using a .env file. At a minimum, set the SESSION_SECRET variable. For an example, see the .env.example file.

Choose a Login.gov Environment

Development Environment (Local Server)

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

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

cd path/to/identity-idp
make run

Sandbox Environment

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

  • https://idp.dev.identitysandbox.gov
  • https://idp.int.identitysandbox.gov

NOTE: this application's credentials have not yet been deployed to the sandbox environments. this note will be removed when the credentials have been deployed and this application has been tested against these sandbox environments.

Usage

Run the app:

go run app.go

Then view in browser at localhost:8080.

About

An example Login.gov client application which authenticates users via OpenID Connect (OIDC). Written in Go. Uses the Gin web framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.3%
  • CSS 0.7%