Open ID Connect (OIDC)
OpenID Connect (OIDC) is an authentication protocol built on top of OAuth 2.0. It allows a user to authenticate with an external identity provider.
Authsignal’s OIDC integration allows OIDC clients to federate passwordless and multi-factor authentication (MFA) flows to Authsignal, securely returning back the outcome of the authentication challenge through a set of claims.
Authsignal OIDC Flows
The Authsignal OIDC flows extends on the OIDC protocol in two ways:
- The authorization endpoint (
/oidc/auth
) will only work within the scope of an already identified resource owner, typically a userId identifying the resource owner. This extension requires a short lived access token to be generated before redirecting the resource owner to the authorization endpoint via our initialization auth endpoint (/init-auth
). The access token geneated will be appended to the authorization endpoint (/oidc/auth
) as a URL parameter namedtoken
- On redirection, in the Authsignal OIDC flow, regardless of authentication outcome, we will always respond with a authorization code grant type. This slightly deviates from the OIDC specification, where un-successful outcomes do not generate an authorization code. It is important for the client to exchange the authorization code for an acess token (
/oidc/token
), and inspect theaction_state
claim to decide whether to proceed with business logic or a authetication pipeline in their flows.
Example OIDC flow diagram
Endpoints
As documented in the above diagram and description, there are 3 important endpoints.
- Initialize Authentication Endpoint (
/init-auth
) - OIDC Authorize Endpoint (
/oidc/auth
) - OIDC Access Token Exchange (
/oidc/token
)
Endpoint URLs
Region | API URL |
---|---|
US (Oregon) | https://connect.authsignal.com |
AU (Sydney) | https://au-connect.authsignal.com |
EU (Dublin) | https://eu-connect.authsignal.com |
1. Initialize Authentication
The initialize authentication POST /init-auth
endpoint is a prerequisite before redirecting the user to the OIDC Authorize endpoint. This endpoint allows the authorize endpoint to scope the flow to a single userId
and add important metadata to facilitate the Authsignal rules engine to make decisions like whether challenge flows should be performed.
Request
The unique ID for this user in your database.
The code of the action e.g signIn, manageAuthenticators.
The clientId or appId in the context of the calling identity provider.
The scopes being requested by the calling identity provider, formatted as a space-separated list.
A custom JSON object. Use this to send a list of custom data points. Rules can be used to match against these data points.
The flag indicating whether the challenge flow should redirect to the self service management screens for the user to manage their authenticators.
POST /init-auth
Response
The short lived token to be appended to the OIDC authorize GET request.
POST /init-auth
OIDC Protocol Endpoints
The following endpoints documents the OIDC protocol based endpoints. Depending on your client library you may not need to do any additional customizations.
Authsignal’s OIDC connector supports authorization_code
grant types.
Type | Endpoint |
---|---|
OIDC Discovery | https://AUTHSIGNAL\_CONNECT\_HOSTNAME/oidc/.well-known/openid-configuration |
Authorization | https://AUTHSIGNAL\_CONNECT\_HOSTNAME/oidc/auth |
Token (Access Token Exchange) | https://AUTHSIGNAL\_CONNECT\_HOSTNAME/oidc/token |
2. OIDC Authorize Endpoint
The GET /oidc/auth
endpoint is used to interact with the resource owner and get the authorization to access the protected resource. It’s compulsory to pass the token
url parameter to the request along side the compulsory OIDC parameters. The token would have been generated using the /init-auth
call prior.
Request
The Authsignal tenant ID.
The short lived token generated in /init-auth.
All responses from this endpoint results in a redirect to this URL.
The OAuth state parameter. If this is set in the request then it will be returned to the application as part of the redirect_uri.
GET /oidc/auth
3. OIDC Token Endpoint
The POST /oidc/token
endpoint is used by the application/client in order to get an access token. Expect to always call this endpoint, parse the access token and determine the state of the Authsignal challenge/auth flow using the action_state
claim.
Request
The grant type for the OIDC flow, Authsignal only supports authorization_code.
The authorization code returned from the redirect.
The Authsignal tenant ID.
The Authsignal tenant secret.
Response
The access token container the JWT claims including the action_state claim.
POST /oidc/token
Action state claim
The access token contains the action_state
claim. The following is an example of the claims data payload.
To evaluate the decision, check the value of the action_state
claim. If the value is CHALLENGE_SUCCEEDED
or ALLOW
continue with processing, if CHALLENGE_FAILED
or BLOCK
is returned termimate any additional authentication processes.
Was this page helpful?