Skip to main content
Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

API v1.0 contract to implement

Download OpenAPI (YAML)Version v1

Base URL: <BASE_URL>

The API contract for pre-issue ID token action (version v1).

Download the OpenAPI definition (YAML)

Security schemes​

BasicAuth: HTTP basic

BearerAuth: HTTP bearer

ApiKeyAuth: API key in header "X-API-Key"

Other​

handle pre-issue ID token events​

POST /

Request body (required): application/json

Schema: RequestBody

5 properties
NameTypeRequiredDescription
flowIdstring

A unique identifier that associates with the token issuing flow in WSO2 Identity Platform

requestIdstring

A unique correlation identifier that associates with the token request received by WSO2 Identity Platform

actionTypestringYes

Specifies the action being triggered, which in this case is PRE_ISSUE_ID_TOKEN.

Allowed values: PRE_ISSUE_ID_TOKEN

eventEventYes

Defines the context data related to the pre issue ID token event that needs to be shared with the custom service to process and execute.

allowedOperationsAllowedOperationsYes

Defines the set of operations that your external service is permitted to perform on the ID token's claims.

Responses

CodeDescriptionSchema
200

Ok

one of: SuccessResponse, FailedResponse
400

Bad Request

ErrorResponse
500

Server Error

ErrorResponse

Schemas​

Event​

Type: object

Defines the context data related to the pre issue ID token event that needs to be shared with the custom service to process and execute.

6 properties
NameTypeRequiredDescription
requestRequestYes

Any additional parameters included in the ID token request. These may be custom parameters defined by the client or necessary for specific flows.

tenantTenantYes

This property represents the tenant under which the token request is being processed.

userUser

Contains information about the authenticated user associated with the token request.

organizationOrganization

This property represents the organization context.

userStoreUserStore

Indicates the user store in which the user's data is being managed.

idTokenIdTokenYes

Represents the ID token that is about to be issued. It contains claims of the ID token which can then be modified by your external service based on the logic implemented in the pre-issue ID token action.

Request​

Type: object

Any additional parameters included in the ID token request. These may be custom parameters defined by the client or necessary for specific flows.

6 properties
NameTypeRequiredDescription
grantTypestring

The type of OAuth2 grant used for the token request, such as authorization_code, password, refresh_token, organization_switch or urn:ietf:params:oauth:grant-type:device_code.

responseTypestring

The type of response requested by the client in the OIDC hybrid flow, such as code id_token token, or code id_token.

clientIdstring

The unique identifier of the client (application) that is requesting the ID token.

scopesarray of string

The scopes present in the incoming token request (OAuth2/OIDC hybrid flow). The openid scope must be present to obtain an ID token. Some scopes control what is included in the ID token (for example, profile for profile-related claims and address for address-related claims). Other scopes appear here because they are associated with permissions on the access token issued together with the ID token.

additionalHeadersarray of RequestHeaders

Any additional HTTP headers included in the ID token request. These may contain custom information or metadata sent by the client.

additionalParamsarray of RequestParams

Tenant​

Type: object

This property represents the tenant under which the token request is being processed.

2 properties
NameTypeRequiredDescription
idstringYes

The unique numeric identifier of the tenant.

namestringYes

The domain name of the tenant.

User​

Type: object

Contains information about the authenticated user associated with the token request.

9 properties
NameTypeRequiredDescription
idstring

Defines the unique identifier of the user.

organizationOrganization

Refers to the organization to which the user belongs.

userTypestring

Defines the type of user. LOCAL indicates a user that exists in WSO2 Identity Platform organization; FEDERATED indicates a federated user authenticated via a federated identity provider.

federatedIdPstring

The name of the federated identity provider used to authenticate the user. This is only applicable for FEDERATED users.

accessingOrganizationOrganization

Refers to the organization that the user is accessing. Applies only to the organization_switch grant type.

accessingOrganization.idstringYes

The unique identifier of the organization.

accessingOrganization.namestringYes

Name of the organization used to identify the organization in configurations, user interfaces, etc.

accessingOrganization.orgHandlestring

The organization handle.

accessingOrganization.depthinteger

The depth of the organization in the hierarchy.

Organization​

Type: object

This property represents the organization context.

4 properties
NameTypeRequiredDescription
idstringYes

The unique identifier of the organization.

namestringYes

Name of the organization used to identify the organization in configurations, user interfaces, etc.

orgHandlestring

The organization handle.

depthinteger

The depth of the organization in the hierarchy.

UserStore​

Type: object

Indicates the user store in which the user's data is being managed.

2 properties
NameTypeRequiredDescription
idstringYes

The unique identifier for the user store.

namestringYes

User store name used to identify the user store in configuration settings, user interfaces, and administrative tasks.

IdToken​

Type: object

Represents the ID token that is about to be issued. It contains claims of the ID token which can then be modified by your external service based on the logic implemented in the pre-issue ID token action.

1 property
NameTypeRequiredDescription
claimsarray of IdTokenClaimsYes

An array that contains both standard ID token claims and any OpenID Connect (OIDC) claims configured to be included in the ID token.

Standard claims:

  • iss: The issuer of the token.
  • at_hash: The hash of the access token value.
  • c_hash: The hash of the authorization code value.
  • s_hash: The hash of the state value.
  • sid: The session ID claim.
  • expires_in: The duration (in seconds) for which the token is valid.
  • realm: The realm (tenant or organization context).
  • tenant: The tenant identifier.
  • userstore: The user store identifier.
  • isk: The identity provider session key.
  • sub: The subject identifier for the token.
  • aud: The audience for the token.
  • exp: The expiration time (Unix timestamp).
  • iat: The time at which the token was issued (Unix timestamp).
  • auth_time: The time at which the user authenticated (Unix timestamp).
  • nonce: The nonce value.
  • acr: The authentication context class reference.
  • amr: The authentication methods references.
  • azp: The authorized party for the token.

OIDC claims are any additional claims configured in the application to be included in the ID token. These claims are based on the OIDC standard and may include user profile information such as email, given_name, or custom claims specific to the application.

AllowedOperations​

Type: array of any of: addOperation, replaceOperation, removeOperation

Defines the set of operations that your external service is permitted to perform on the ID token's claims.

addOperation​

Type: object

Defines the add operation.

2 properties
NameTypeRequiredDescription
opstringYes

Allowed values: add

pathsarray of stringYes

replaceOperation​

Type: object

Defines the replace operation.

2 properties
NameTypeRequiredDescription
opstringYes

Allowed values: replace

pathsarray of stringYes

removeOperation​

Type: object

Defines the remove operation.

2 properties
NameTypeRequiredDescription
opstringYes

Allowed values: remove

pathsarray of stringYes

SuccessResponse​

Type: object

Defines the success response.

2 properties
NameTypeRequiredDescription
actionStatusstringYes

Indicates the outcome of the request. For a successful operation, this should be set to SUCCESS.

Allowed values: SUCCESS

operationsarray of any of: addOperationResponse, replaceOperationResponse, removeOperationResponse

Defines the set of operations that your external service is requesting to perform on the ID token's claims.

FailedResponse​

Type: object

3 properties
NameTypeRequiredDescription
actionStatusstringYes

Indicates the outcome of the request. For a failed operation, this should be set to FAILED.

Allowed values: FAILED

failureReasonstringYes

Provides the reason for failing to issue an ID token.

failureDescriptionstringYes

Offers a detailed explanation of the failure.

ErrorResponse​

Type: object

When the external service responds with an ERROR state, it can return an HTTP status code of 400, 401, or 500, indicating either a validation failure or an issue processing the request.

3 properties
NameTypeRequiredDescription
actionStatusstringYes

Indicates the outcome of the request. For an error operation, this should be set to ERROR.

Allowed values: ERROR

errorMessagestringYes

The cause of the error.

errorDescriptionstringYes

A detailed description of the error.

RequestBody​

Type: object

5 properties
NameTypeRequiredDescription
flowIdstring

A unique identifier that associates with the token issuing flow in WSO2 Identity Platform

requestIdstring

A unique correlation identifier that associates with the token request received by WSO2 Identity Platform

actionTypestringYes

Specifies the action being triggered, which in this case is PRE_ISSUE_ID_TOKEN.

Allowed values: PRE_ISSUE_ID_TOKEN

eventEventYes

Defines the context data related to the pre issue ID token event that needs to be shared with the custom service to process and execute.

allowedOperationsAllowedOperationsYes

Defines the set of operations that your external service is permitted to perform on the ID token's claims.

RequestHeaders​

Type: object

2 properties
NameTypeRequiredDescription
namestringYes
valuearray of stringYes

RequestParams​

Type: object

2 properties
NameTypeRequiredDescription
namestringYes
valuearray of stringYes

IdTokenClaims​

Type: object

2 properties
NameTypeRequiredDescription
namestringYes
valueone of: string, integer, boolean, array of string, object

addOperationResponse​

Type: object

Defines the add operation response.

3 properties
NameTypeRequiredDescription
opstringYes

Allowed values: add

pathstringYes

Defines the path for the add operation. Should be one from the allowed paths of add operation in the allowedOperations.

valueone of: string, CustomValueYes

Defines the value for the add operation.

replaceOperationResponse​

Type: object

Defines the replace operation response.

3 properties
NameTypeRequiredDescription
opstringYes

Allowed values: replace

pathstringYes

Defines the path for the replace operation. Should be one from the allowed paths of replace operation in the allowedOperations.

valueone of: string, objectYes

Defines the value for the replace operation.

removeOperationResponse​

Type: object

Defines the remove operation response.

2 properties
NameTypeRequiredDescription
opstringYes

Allowed values: remove

pathstringYes

Defines the path for the remove operation. Should be one from the allowed paths of remove operation in the allowedOperations.

CustomValue​

Type: object

2 properties
NameTypeRequiredDescription
namestringYes
valueone of: string, integer, boolean, array of string, objectYes

Was this page helpful?