For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /specs/oidc.md.

OIDC

Overview

OpenID Connect (OIDC) Core 1.0 is an authentication protocol that is built on top of the OAuth 2.0 authorisation protocol. It allows relying parties to verify the identity of the end-user and to obtain basic user profile information. OIDC uses the standardised message flows from OAuth 2.0 to provide identity services.

Supported Grant Types

Edupass supports the following grant types:

  1. Authorisation Code Flow with Proof Key for Code Exchange (PKCE).

Authorisation Code Flow with Proof Key for Code Exchange (PKCE)

Info

Since Edupass makes use of Entra ID as its OIDC provider, this section is based off https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow but adapted for Edupass’s context.

The following sequence diagram provides a step-by-step breakdown of the entire authorisation code flow with PKCE. Noteworthy steps in the sequence diagram are elaborated upon below.

Authorisation code flow with PKCE

Note

Note that the RP in the sequence diagram is split into “Frontend (Public Client)” and “Backend (Confidential Client)”. This distinction is necessary in an OAuth 2.0 context due to the following security consideration:

  • Public client - Cannot securely store client secrets.
  • Confidential client - Can securely store client secrets.

Examples of RPs which contain both a frontend and a backend include:

  1. Web applications with a single page application (SPA) frontend written in JavaScript.
  2. Desktop and mobile applications.

For the former, the source code of SPAs, along with any client secrets within, is available in its entirety to the browser. For the latter, the desktop/mobile frontend can be decompiled to retrieve its source code, along with any client secrets within.

RPs which do not have a frontend should treat the “Frontend (Public Client)” and “Backend (Confidential Client)” lifelines as a single lifeline.

[1] Code Verifier & Code Challenge Generation

Proof Key for Code Exchange (PKCE)

Public clients are susceptible to authorisation code interception attacks as described in https://datatracker.ietf.org/doc/html/rfc7636#section-1.

To guard against such attacks, the PKCE-enhanced authorisation code flow introduces a secret created by the RP in the form of the code verifier. When retrieving the authorisation code, the RP sends over a transformed value of the code verifier called the code challenge which is bound to the authorisation code that the authorisation endpoint returns. Subsequently, when exchanging the authorisation code for a token, a code verifier that transforms into the bound code challenge needs to be sent, else the token endpoint will reject the request. This prevents attackers from exchanging intercepted authorisation codes with tokens as they will not have the corresponding code verifier.

Tip

[Defense in depth] For confidential clients, the use of PKCE is recommended as it provides strong protection against the misuse and injection of authorisation codes. This recommendation is outlined in https://datatracker.ietf.org/doc/html/rfc9700#name-authorization-code-grant.

To secure the authorisation code grants using Proof Key for Code Exchange (PKCE), the client needs to generate both a code verifier and a code challenge before initiating a request to the authorisation endpoint.

The code verifier is a high-entropy cryptographic string with a minimum length of 43 characters and a maximum length of 128 characters. It can consist of alphanumeric characters, along with the hyphen (-), period (.), underscore (_) and tilde (~) characters.

code-verifier = 43*128unreserved
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
ALPHA = %x41-5A / %x61-7A
DIGIT = %x30-39

The client should then derive the code challenge from the code verifier by:

  1. Calculating the SHA256 hash of the code verifier.
  2. Encoding the SHA256 hash with the base64url encoding.
code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))

[2] Authorisation Endpoint Request

The authorisation code flow begins with the client redirecting the user to the /authorize endpoint to request for an authorisation code.

GET https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize?
client_id=00001111-aaaa-2222-bbbb-3333cccc4444
&response_type=code
&redirect_uri=http%3A%2F%2Flocalhost%2Fredirect
&response_mode=form_post
&scope=openid
&state=12345
&code_challenge=YTFjNjI1OWYzMzA3MTI4ZDY2Njg5M2RkNmVjNDE5YmEyZGRhOGYyM2IzNjdmZWFhMTQ1ODg3NDcxY2Nl
&code_challenge_method=S256
ParameterRequired?Description
tenantRequiredThe ID of the Edupass Entra ID tenant.
- Preprod: 97f42547-72fd-4d98-b89a-e39375923893
- Prod: 342e7f12-abca-4f63-9a52-ce093487bbc1
client_idRequiredThe ID of the application (client) in the Edupass Entra ID tenant. This should have been communicated by the Edupass team during the RP onboarding process.
- This value is unique per environment, e.g., preprod, prod.
response_typeRequiredMust be set to code for the authorisation code flow.
redirect_uriRequiredThe redirect URI of the client. Upon successful authentication and authorisation, Edupass will redirect the user to the specified URI with the authorisation code.
- Must be URL-encoded.
- For security reasons, the redirect URI specified must match one of the redirect URIs configured during RP onboarding. Otherwise, the following error message will be displayed to the user: AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application
scopeRequiredMust be set to openid.
- If no openid scope value is present, the request may still be a valid OAuth 2.0 request but is not an OIDC request. The following error message will be displayed to the user: AADSTS70011: The provided request must include a 'scope' input parameter. The provided value for the input parameter 'scope' is not valid. The scope <scope> is not valid. openid scope is required.
- Additional values in the scope parameter should not be used to get additional claims about the user as Edupass does not guarantee the correctness of these claims.
code_challengeRequired for public clients / Recommended for confidential clientsUsed to secure authorisation code grants by using PKCE.
- See [1] Code Verifier & Code Challenge Generation for details.
code_challenge_methodRequired for public clients / Recommended for confidential clientsThe method used to encode the code_verifier for the code_challenge parameter. Must be set to S256.
- See [1] Code Verifier & Code Challenge Generation for details.
response_modeRecommendedSpecifies how Edupass will return the authorisation code to the client. Highly recommended to be set to form_post.
- When set to query by default, the authorisation code is provided as a query string parameter via a GET request to the redirect URI. This results in the authorisation code being exposed through the browser history, server logs, and the Referer header, increasing the risk of session hijacking.
- When set to form_post, the authorisation code is instead provided as part of the request body via a POST request to the redirect URI.
stateRecommendedA value included in the request that is also returned in the token response. The chosen value is up to the client.
- This value should be used to encode the CSRF token, a secret and unpredictable value. RPs should validate that the value of the CSRF token in the state returned by the authorisation endpoint response is the same as the value set in the authorisation endpoint request to prevent CSRF attacks. See [5] Cross-Site Request Forgery (CSRF) Prevention for details.
- This value can be used to encode information about the user’s state in the RP before the authentication request occurred. For example, it can be used to encode the page that they were on, so that the same page can be restored after they are redirected back to the RP.
login_hintOptionalCan be used to pre-fill the user principal name on the sign-in page for the user if known.
domain_hintNot recommendedIf set, skips the home realm discovery process and auto-accelerates the sign-in process to the Entra ID tenant associated with the domain.
- Edupass federates with both the WOG and MOE M365 T&L Entra ID tenants to allow our users to reuse their existing identities. As a result, we do not recommend that RPs set this parameter as it might result in certain Edupass users not being able to log in.
promptNot recommendedIndicates the type of user interaction that is required. The default behavior is to either sign in the sole current user, show the account picker if there are multiple users, or show the login page if there are no users signed in.
- Should not be set to any value as doing so will result in the user sign-in experience deviating from the default behaviour, potentially breaking the sign-in process.

[3] Authorisation Endpoint Response (Error)

When an error occurs during the authentication and authorisation process, Edupass will redirect the user to the URI specified in redirect_uri with an error message.

POST http://localhost/redirect
Referer: https://login.microsoftonline.com/
Content-Type: application/x-www-form-urlencoded

error=server_error
&error_description=the+server+encountered+an+unexpected+error
ParameterDescription
errorAn error code string that can be used to classify types of errors, and to react to errors. This part of the error is provided so that the app can react appropriately to the error, but doesn't explain in depth why an error occurred.
error_descriptionA specific error message that can help a developer identify the cause of an authentication error. This part of the error contains most of the useful information about why the error occurred.
stateIf a state parameter was included in the corresponding authorisation endpoint request, the same value should appear in the response.
- RPs should validate that the value of the CSRF token in the state returned by the authorisation endpoint response is the same as the value set in the authorisation endpoint request to prevent CSRF attacks. See [5] Cross-Site Request Forgery (CSRF) Prevention for details.
Info

An error response for the authorisation endpoint is returned only under exceptional circumstances. For expected scenarios such as users not being able to successfully authenticate or authorise, Edupass will directly display an error message to the user without redirecting them back to the RP.

List of error codes

Taken from https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow#error-codes-for-authorization-endpoint-errors.

Error CodeDescriptionClient Action
invalid_requestProtocol error, such as a missing required parameter.Fix and resubmit the request. This error is a development error typically caught during initial testing.
unauthorized_clientThe client application isn't permitted to request an authorization code.This error usually occurs when the client application isn't registered in Microsoft Entra ID or isn't added to the user's Microsoft Entra tenant. The application can prompt the user with instructions for installing the application and adding it to Microsoft Entra ID.
access_deniedResource owner denied consentThe client application can notify the user that it can't continue unless the user consents.
unsupported_response_typeThe authorization server doesn't support the response type in the request.Fix and resubmit the request. This error is a development error typically caught during initial testing. In the hybrid flow, this error signals that you must enable the ID token implicit grant setting on the client app registration.
server_errorThe server encountered an unexpected error.Retry the request. These errors can result from temporary conditions. The client application might explain to the user that its response is delayed due to a temporary error.
temporarily_unavailableThe server is temporarily too busy to handle the request.Retry the request. The client application might explain to the user that its response is delayed because of a temporary condition.
invalid_resourceThe target resource is invalid because it doesn't exist, Microsoft Entra ID can't find it, or it's not correctly configured.This error indicates the resource, if it exists, hasn't been configured in the tenant. The application can prompt the user with instructions for installing the application and adding it to Microsoft Entra ID.
login_requiredToo many or no users found.The client requested silent authentication (prompt=none), but a single user couldn't be found. This error may mean there are multiple users active in the session, or no users. This error takes into account the tenant chosen. For example, if there are two Microsoft Entra accounts active and one Microsoft account, and consumers is chosen, silent authentication works.
interaction_requiredThe request requires user interaction.Another authentication step or consent is required. Retry the request without prompt=none.

[4] Authorisation Endpoint Response (Success)

After the user successfully authenticates and authorises with Edupass, they will be redirected to the URI specified in redirect_uri with the authorisation code.

POST http://localhost/redirect
Referer: https://login.microsoftonline.com/
Content-Type: application/x-www-form-urlencoded

code=AwABAAAAvPM1KaPlrEqdFSBzjqfTGBCmLdgfSTLEMPGYuNHSUYBrq...
&state=12345
ParameterDescription
codeThe authorisation code as requested by the client. RPs can use the authorisation code to request for an access token for the target resource.
- Authorisation codes are short-lived, with a validity of approximately 10 minutes plus a buffer for clock skew.
stateIf a state parameter was included in the corresponding authorisation endpoint request, the same value should appear in the response.
- RPs should validate that the value of the CSRF token in the state returned by the authorisation endpoint response is the same as the value set in the authorisation endpoint request to prevent CSRF attacks. See [5] Cross-Site Request Forgery (CSRF) Prevention for details.

[5] Cross-Site Request Forgery (CSRF) Prevention

Cross-Site Request Forgery (CSRF)

Cross-Site Request Forgery (CSRF) is a class of exploits where an attacker causes a user to follow a malicious URI (e.g., via a misleading link, an embedded image, or redirection) to a trusting server (usually established through the presence of a session cookie).

A CSRF attack against an RP's redirect URI allows an attacker to inject their own authorisation code, which can result in the RP using an access token associated with the attacker's protected resources rather than the user's. This could be used to save confidential information belonging to the user to a protected resource controlled by the attacker.

To guard against CSRF attacks, RPs should generate an unpredictable value called the CSRF token before each request to the authorisation endpoint. This CSRF token should be encoded within the state parameter of the authorisation request, which the OIDC provider will reflect back as part of the authorisation response. RPs are then able to distinguish between genuine authorisation responses from malicious attacker-forged authorisation responses by the presence of a valid CSRF token in the state parameter of the authorisation response.

Warning

RPs should implement CSRF tokens even if they also implement PKCE.

The use of PKCE protects against certain CSRF attacks as an attacker-injected authorisation code will not match the PKCE code verifier, and thus will not be able to be exchanged for any tokens. However, it does not protect against CSRF attacks which do not require token exchange. The use of CSRF tokens is necessary to protect against the full range of possible CSRF attacks.

Before initiating requests to the authorisation endpoint, RPs should generate a secret, unpredictable value to act as the CSRF token. This CSRF token should be generated on a per-request basis, and should not be reused across requests.

When making requests to the authorisation endpoint, RPs should encode the CSRF token as part of the state parameter. The CSRF token should also be stored as part of the user’s session, be it as a server-side session, or as a secure HTTP-only cookie.

// Create a CSRF token to prevent request forgery.
const csrfToken = generateRandomValue();
// Store it in the user's session for later validation.
req.session.csrfToken = csrfToken;

// Multiple pieces of information can be encoded in the `state` parameter using a
// stringified JSON object. This is useful for RPs that wish to encode certain
// information about the user's state, such as the current page they are on, so
// that it can be restored after they are redirected back to the RP.
const state = JSON.stringify({
  csrfToken,
  uriBeforeLogin: getCurrentUri(),
});

Upon receiving an authorisation endpoint response, RPs should compare the value of the state parameter in the response with that of the request as stored in the user’s session. If the values do not match, RPs should reject the response.

// Parse the `state` parameter in the authorisation endpoint response.
const receivedState = JSON.parse(req.body.state);
const receivedCsrfToken = receivedState.csrfToken;
// Validate that the CSRF token in the `state` parameter is the same as the one
// stored in the user's session.
if (receivedCsrfToken !== req.session.csrfToken) {
  // Reject authorisation endpoint response as it might have been forged.
}
Note

The CSRF token should be validated even for error authorisation endpoint responses to guard against malicious error responses forged by an attacker.

[6] Token Endpoint Request

Together with the code verifier generated in [1] Code Verifier & Code Challenge Generation, the authorisation code acquired should then be exchanged for ID, access, and refresh tokens by making a call to the /token endpoint.

POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded

client_id=11112222-bbbb-3333-cccc-4444dddd5555
&code=OAAABAAAAiL9Kn2Z27UubvWFPbm0gLWQJVzCTE9UkP3pSx1aXxUjq3n8b2JRLk4OxVXr...
&redirect_uri=http%3A%2F%2Flocalhost%2Fredirect
&grant_type=authorization_code
&code_verifier=ThisIsntRandomButItNeedsToBe43CharactersLong
&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer
&client_assertion=eyJhbGciOiJSUzI1NiIsIng1dCI6Imd4OHRHeXN5amNScUtqRlBuZDdSRnd2d1pJMCJ9.eyJ{a lot of characters here}M8U3bSUKKJDEg
ParameterRequired?Description
tenantRequiredThe ID of the Edupass Entra ID tenant.
- Preprod: 97f42547-72fd-4d98-b89a-e39375923893
- Prod: 342e7f12-abca-4f63-9a52-ce093487bbc1
client_idRequiredThe ID of the application (client) in the Edupass Entra ID tenant. This should have been communicated by the Edupass team during the RP onboarding process.
- This value is unique per environment, e.g., preprod, prod.
codeRequiredThe authorisation code that was acquired from the authorisation endpoint.
redirect_uriRequiredThe redirect URI that was used in the request to acquire the authorisation code.
grant_typeRequiredMust be set to authorization_code.
code_verifierRequired for public clients / Recommended for confidential clientsThe code verifier that was used in the request to acquire the authorisation code.
- See [1] Code Verifier & Code Challenge Generation for details.
client_assertion_typeRequired for confidential clients onlyMust be set to urn:ietf:params:oauth:client-assertion-type:jwt-bearer.
client_assertionRequired for confidential clients onlyA JSON Web Token (JWT) that is created and signed with the certificate registered during RP onboarding.
- See Client Assertion Generation for the format of the JWT.
scopeNot recommendedThis parameter is a Microsoft extension to the authorisation code flow that does not exist in the OIDC spec. RPs should not set it to any value.
- When omitted, the tokens issued will be for the scopes defined as part of the call to the authorisation endpoint.
- Additional values in the scope parameter should not be used to get additional claims about the user as Edupass does not guarantee the correctness of these claims.

Client Assertion Generation

For added security, confidential clients are required to authenticate themselves with Entra ID using a JSON Web Token (JWT) assertion when making requests to the token endpoint. Public clients are exempt from this requirement because they are unable to securely store secrets.

Note

The X.509 certificate mentioned in this section refers to the one provided by the RP to the Edupass team during onboarding.

The JWT assertion is made up of 3 parts, a header, claims, and signature.

Contains metadata about the type of the token and the cryptographic algorithms used to secure its contents.

ParameterDescription
algShould be PS256.
typShould be JWT.
x5t#S256Base64url-encoded SHA-256 thumbprint of the X.509 certificate's DER encoding.
Claims

Contains assertions about the RP.

Claim TypeValueDescription
audhttps://login.microsoftonline.com/{tenantId}/oauth2/v2.0/tokenThe aud (audience) claim identifies the recipients that the JWT is intended for. In this case, the recipient is the login server (login.microsoftonline.com).
The tenant IDs are as follows:
- Preprod: 97f42547-72fd-4d98-b89a-e39375923893
- Prod: 342e7f12-abca-4f63-9a52-ce093487bbc1
expA time represented by seconds since Unix epochThe "exp" (expiration time) claim identifies the expiration time on or after which the JWT must not be accepted for processing. This allows the assertion to be used until then, so it is recommended to be 5 - 10 minutes after nbf at most. Microsoft Entra ID does not place restrictions on the exp time currently.
issClient IDThe iss (issuer) claim identifies the principal that issued the JWT, in this case your application.
The client ID should have been communicated by the Edupass team during the RP onboarding process.
- This value is unique per environment, e.g., preprod, prod.
jtiA globally unique identifier assigned by the RPThe jti (JWT ID) claim provides a unique identifier for the JWT. The identifier value must be assigned in a manner that ensures that there's a negligible probability that the same value will be accidentally assigned to a different data object; if the application uses multiple issuers, collisions MUST be prevented among values produced by different issuers as well. The "jti" value is a case-sensitive string.
nbfA time represented by seconds since Unix epochThe "nbf" (not before) claim identifies the time before which the JWT must not be accepted for processing. Using the current time is appropriate.
subClient IDThe "sub" (subject) claim identifies the subject of the JWT, in this case also your application. Use the same value as iss.
The client ID should have been communicated by the Edupass team during the RP onboarding process.
- This value is unique per environment, e.g., preprod, prod.
iatCurrent time represented by seconds since Unix epochThe "iat" (issued at) claim identifies the time at which the JWT was issued. This claim can be used to determine the age of the JWT.
Signature

Used to validate that the token is trustworthy and has not been tampered with.

To create the signature,

  1. Base64url-encode the header and the claims.
  2. Join the encoded header and claims with a dot.
  3. Hash the combined string using SHA-256.
  4. Sign the hash using the RSA private key of the X.509 certificate with the RSASSA-PSS (Probabilistic Signature Scheme) padding scheme.
Encoded JWT

To form the final encoded JWT that will be sent as an assertion, base64url-encode the header, claims and signature separately, then join them with dots.

{encodedHeader}.{encodedClaims}.{encodedSignature}

[7] Token Endpoint Response (Error)

The following response is returned when an error occurs during token exchange.

{
  "error": "invalid_scope",
  "error_description": "AADSTS70011: The provided value for the input parameter 'scope' is not valid. The scope https://foo.microsoft.com/mail.read is not valid.\r\nTrace ID: 0000aaaa-11bb-cccc-dd22-eeeeee333333\r\nCorrelation ID: aaaa0000-bb11-2222-33cc-444444dddddd\r\nTimestamp: 2016-01-09 02:02:12Z",
  "error_codes": [70011],
  "timestamp": "2016-01-09 02:02:12Z",
  "trace_id": "0000aaaa-11bb-cccc-dd22-eeeeee333333",
  "correlation_id": "aaaa0000-bb11-2222-33cc-444444dddddd"
}
ParameterDescription
errorAn error code string that can be used to classify types of errors, and to react to errors. This part of the error is provided so that the app can react appropriately to the error, but doesn't explain in depth why an error occurred.
error_descriptionA specific error message that can help a developer identify the cause of an authentication error. This part of the error contains most of the useful information about why the error occurred.
error_codesA list of STS-specific error codes that can help in diagnostics.
timestampThe time at which the error occurred.
trace_idA unique identifier for the request that can help in diagnostics.
correlation_idA unique identifier for the request that can help in diagnostics across components.
List of error codes

Taken from https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow#error-codes-for-token-endpoint-errors.

Error CodeDescriptionClient Action
invalid_requestProtocol error, such as a missing required parameter.Fix and resubmit the request. This error is a development error typically caught during initial testing.
invalid_grantThe authorization code or PKCE code verifier is invalid or has expired.Try a new request to the /authorize endpoint and verify that the code_verifier parameter was correct.
unauthorized_clientThe authenticated client isn't authorised to use this authorisation grant type.This error usually occurs when the client application isn't registered in Microsoft Entra ID or isn't added to the user's Microsoft Entra tenant. The application can prompt the user with instructions for installing the application and adding it to Microsoft Entra ID.
invalid_clientClient authentication failed.The client credentials aren't valid. To fix, the Application Administrator updates the credentials.
unsupported_grant_typeThe authorization server doesn't support the authorization grant type.Change the grant type in the request. This type of error should occur only during development and be detected during initial testing.
invalid_resourceThe target resource is invalid because it doesn't exist, Microsoft Entra ID can't find it, or it's not correctly configured.This code indicates the resource, if it exists, hasn't been configured in the tenant. The application can prompt the user with instructions for installing the application and adding it to Microsoft Entra ID.
interaction_requiredNon-standard, as the OIDC specification calls for this code only on the /authorize endpoint. The request requires user interaction. For example, another authentication step is required.Retry the /authorize request with the same scopes.
temporarily_unavailableThe server is temporarily too busy to handle the request.Retry the request after a small delay. The client application might explain to the user that its response is delayed because of a temporary condition.
consent_requiredThe request requires user consent. This error is non-standard. It's usually only returned on the /authorize endpoint per OIDC specifications. Returned when a scope parameter was used on the code redemption flow that the client app doesn't have permission to request.The client should send the user back to the /authorize endpoint with the correct scope to trigger consent.
invalid_scopeThe scope requested by the app is invalid.Update the value of the scope parameter in the authentication request to a valid value.

[8] Token Endpoint Response (Success)

The following response is returned when the token exchange is successful:

{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEstZnl0aEV1Q...",
  "token_type": "Bearer",
  "expires_in": 3599,
  "scope": "openid",
  "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIyZDRkMTFhMi1mODE0LTQ2YTctOD..."
}
ParameterDescription
access_tokenThe requested access token. The RP can use this token to authenticate to the secured resource, such as a web API.
token_typeIndicates the token type value. The only type that Microsoft Entra ID supports is Bearer.
expires_inHow long the access token is valid, in seconds.
scopeThe scopes that the access_token is valid for. This parameter is a Microsoft extension to the authorisation code flow that does not exist in the OIDC spec.
id_tokenA JSON Web Token. RPs can decode the segments of this token to read information about the user who signed in. The app can cache the values and display them, and confidential clients can use this token for authorization.
Note: Only provided if openid scope was requested.

ID Token

The ID token is a JWT containing information about the user that has authenticated.

Example ID token returned when only the openid scope is set:

{
  aud: '41729a12-5f6d-4fd9-9ce3-800e73d10148',
  iss: 'https://login.microsoftonline.com/2aef017b-0afb-47d9-a1ab-23148b712d37/v2.0',
  iat: 1771832184,
  nbf: 1771832184,
  exp: 1771836084,
  groups: [ '1730_AE_admin', '1731_AE_user' ],
  rh: '1.Ab4AewHvKvsK2UehqyMUi3EtNxKackFtX9lPnOOADnPRAUgAALy-AA.',
  sid: '00220eda-823e-0889-c17e-3c68acc55b82',
  sub: 'mw81pr7Tm0tCXgX2jHZ2SoCgW1O_M9PuqjQtVst5hqQ',
  tid: '2aef017b-0afb-47d9-a1ab-23148b712d37',
  uti: 'qSDQQ0ISs0WctHsmKsEkAA',
  ver: '2.0',
  id: '000012345678',
  identityType: 'Staff',
  identitySource: "HRPS",
  name: 'John Tan',
  uinFin: 'S0000001I',
  schoolOrHq: 'School',
  title: 'Teacher',
  notificationEmail: 'john_tan@schools.gov.sg',
  cesEmail: 'john_tan@schools.gov.sg',
  iconEmail: 'john_tan@moe.edu.sg'
}
Info

Claims with null or empty values are omitted in the ID token object in accordance with the OIDC specifications: https://openid.net/specs/openid-connect-core-1_0.html#UserInfoResponse. In the example above, the user does not have a WOG email address, and thus the wogEmail claim is omitted entirely.

ParameterDescription
audIdentifies the intended recipient of the token. This value should be validated. The token should be rejected if it fails to match the RP's client ID.
issIdentifies the issuer, or "authorization server" that constructs and returns the token. It also identifies the tenant for which the user was authenticated. If the token was issued by the v2.0 endpoint, the URI ends in /v2.0. The RP should use the GUID portion of the claim to restrict the set of tenants that can sign in to the RP, if applicable.
iatA Unix timestamp that indicates when the authentication for the token occurred.
nbfA Unix timestamp that indicates the time before which the JWT can't be accepted for processing.
expA Unix timestamp that indicates the expiration time, on or after which the JWT can't be accepted for processing. In certain circumstances, a resource may reject the token before this time. For example, if a change in authentication is required or a token revocation has been detected.
groupsThe set of roles assigned to the user who is logging in. These roles are specific to the RP; roles for other RPs will not be sent.
rhAn internal claim used by Entra ID to revalidate tokens. Should be ignored.
sidRepresents a unique identifier for a session and will be generated when a new session is established.
subThe subject of the information in the token.
RPs should make use of the id claim instead of the sub claim to identify Edupass identities. This is because the value of the sub claim
1. is specific to each RP and cannot be correlated across RPs; and
2. might change over time when Edupass identities are deactivated and reactivated after a period of time.
tidRepresents the tenant that the user is signing in to.
utiToken identifier claim, equivalent to jti in the JWT specification. Unique, per-token identifier that is case-sensitive.
verIndicates the version of the ID token. Should always be 2.0.
Edupass-specific claimsSee Interface Specifications.
Info

Edupass will provide all claims about the user as part of the ID token, rather than via the OIDC UserInfo endpoint.

Upon receiving an ID token, RPs should:

  1. Verify the signature of the token using Entra ID’s signing keys, which can be found at https://login.microsoftonline.com/{tenant_id}/discovery/v2.0/keys.
  2. Validate that the iss claim matches the expected Entra ID tenant, i.e., https://login.microsoftonline.com/{tenant-id}/v2.0.
  3. Validate that the aud claim matches the client ID for the RP.
  4. Validate that the iat, nbf, and exp timestamps all fall before or after the current time, as appropriate.

Access Token

The access token is not currently used.

Refresh Token

The refresh token is used to obtain new access and refresh token pairs when the current access token expires. Along with the access token, it is not currently used.

Signing Out Users

To sign a user out, the following 2 operations must be done:

  1. Redirect the user to Entra ID’s logout endpoint.
  2. End the user’s session in the RP.

Failure to perform either of these operations may result in the user remaining authenticated and not being prompted to sign-in the next time they access the RP.

GET https://login.microsoftonline.com/{tenant}/oauth2/v2.0/logout?
post_logout_redirect_uri=http%3A%2F%2Flocalhost%2Fredirect
Info

The logout endpoint supports both GET and POST requests.

ParameterRequired?Description
tenantRequiredThe ID of the Edupass Entra ID tenant.
- Preprod: 97f42547-72fd-4d98-b89a-e39375923893
- Prod: 342e7f12-abca-4f63-9a52-ce093487bbc1
post_logout_redirect_uriRecommendedThe URL that the user is redirected to after successfully signing out. If the parameter isn't included, the user is shown a generic message that's generated by the Microsoft identity platform. This URL must match one of the redirect URIs registered for your application in the app registration portal.
logout_hintOptionalEnables sign-out to occur without prompting the user to select an account.