Skip to content

Example OpenID Connect relying party as a Sinatra app

License

Notifications You must be signed in to change notification settings

18F/identity-oidc-sinatra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

identity-openidconnect-sinatra

An example of a Relying Party for OpenID Connect written as a simple Sinatra app in Ruby.

Running locally

  1. Set up the environment with:
$ make setup
  1. And run the app server:
$ make run
  1. To run specs:
$ make test

Configuring

  1. This sample service provider is configured to run on http://localhost:9292 by default. Optionally, you can assign a custom hostname or port by passing HOST= or PORT= environment variables when starting the application server. However, when you do this, you also have to make corresponding changes to the redirect_uri environment variable and also configure the identity provider appropriately.

  2. Some other key environment variables that affect configuration:

    Environment Variable Description Default
    client_id Identifier for this app as configured with the identity provider. Used unless PKCE is true urn:gov:gsa:openidconnect:sp:sinatra
    client_id_pkce Identifier for this app as configured with the identity provider. Used if PKCE is true urn:gov:gsa:openidconnect:sp:sinatra_pkce
    eipp_allowed Enhanced In Person Proofing allowed false
    idp_url URL for the identity provider http://localhost:3000
    PKCE Determines if PKCE or private_key_jwt is used to communicate with the identity provider false
    semantic_ial_values_enabled Determines if semantic IAL values can be used in acr_values fals
    vtr_disabled Vectors of Trust disabled false

Contributing

See CONTRIBUTING for additional information.

Public domain

This project is in the worldwide public domain. As stated in CONTRIBUTING:

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.