OpenID Connect v0.1.0 OpenIDConnect View Source
Handles a majority of the life-cycle concerns with OpenID Connect
Link to this section Summary
Types
The payload of user data from the provider
The code returned by an OpenID Connect provider during the redirect
A provider’s documents
An error tuple
JSON Web Token
The name of the genserver
The provider name as an atom
A string reason for an error failure
The success tuple
URI as a string
Functions
Builds the authorization URI according to the spec in the providers discovery document
Fetches the authentication tokens from the provider
Requests updated documents from the provider
Verifies the validity of the JSON Web Token (JWT)
Link to this section Types
The payload of user data from the provider
The code returned by an OpenID Connect provider during the redirect
documents() :: %{ discovery_document: map(), jwk: JOSE.JWK.t(), remaining_lifetime: integer() | nil }
A provider’s documents
- discovery_document: the provider’s discovery document for OpenID Connect
- jwk: the provider’s certificates converted into a JOSE JSON Web Key
- remaining_lifetime: how long the provider’s JWK is valid for
An error tuple
The 2nd element will indicate which function failed The 3rd element will give details of the failure
JSON Web Token
See: https://jwt.io/introduction/
The name of the genserver
This is optional and will default to :openid_connect
unless overridden
The provider name as an atom
Example: :google
This atom should match what you’ve used in your application config
A string reason for an error failure
The success tuple
The 2nd element will be the relevant value to work with
URI as a string
Link to this section Functions
Builds the authorization URI according to the spec in the providers discovery document
Fetches the authentication tokens from the provider
The code
paramater should be taken from the query param code
in the redirect
back to your application from the provider
Requests updated documents from the provider
This function is used by OpenIDConnect.Worker
for document updates
according to the lifetime returned by the provider
Verifies the validity of the JSON Web Token (JWT)
This verification will assert the token’s encryption against the provider’s JSON Web Key (JWK)