Skip to main content
You're reading Identity & Access Management 7.2.0. The newest release is 7.3.0, and Cloud has the newest features. Go to the newest release

API v1.0 contract to implement

Download OpenAPI (YAML)Version v1.0

Base URL: <BASE_URL>

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

Download the OpenAPI definition (YAML)

Security schemes​

BasicAuth: HTTP basic

BearerAuth: HTTP bearer

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

OAuth2: oauth2

clientCredentials flow, token URL https://example.com/oauth/token

1 scopes
ScopeDescription
processprocess request generate response

Other​

handle pre-issue access 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 Server

requestIdstring

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

actionTypestringYes

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

Allowed values: PRE_ISSUE_ACCESS_TOKEN

eventEventYes

Defines the context data related to the pre issue access 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 access token's claims and scopes.

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 access token event that needs to be shared with the custom service to process and execute.

5 properties
NameTypeRequiredDescription
requestRequestYes

Any additional parameters included in the access token request. These may be custom parameters defined by the client or necessary for specific flows. If no allowed parameters are configured for the action, all parameters in the request are forwarded, including sensitive parameters like client secret, username, and password. Use the excluded parameters server configuration to stop specific parameters from being forwarded.

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.

userStoreUserStore

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

accessTokenAccessTokenYes

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

Request​

Type: object

Any additional parameters included in the access token request. These may be custom parameters defined by the client or necessary for specific flows. If no allowed parameters are configured for the action, all parameters in the request are forwarded, including sensitive parameters like client secret, username, and password. Use the excluded parameters server configuration to stop specific parameters from being forwarded.

5 properties
NameTypeRequiredDescription
grantTypestringYes

The type of OAuth2 grant used for the token request, such as authorization code, client credentials, password, or refresh token. This defines the flow that is being used to obtain the access token.

clientIdstringYes

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

scopesarray of string

The scopes requested by the client, which define the permissions associated with the access token. Scopes determine what resources the access token will grant access to.

additionalHeadersarray of RequestHeaders

Any additional HTTP headers included in the access token request. These may contain custom information or metadata that the client has sent. If no allowed headers are configured for the action, all headers in the request are forwarded, including sensitive headers like ‘Authorization’ and ‘Cookie’. Use the excluded headers server configuration to stop specific headers from being forwarded.

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.

1 property
NameTypeRequiredDescription
idstringYes

Defines the unique identifier of the user.

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.

AccessToken​

Type: object

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

3 properties
NameTypeRequiredDescription
tokenTypestringYes

Defines the type of token.

Allowed values: JWT

claimsarray of AccessTokenClaimsYes

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

Standard claims:

  • sub: The subject identifier for the token, typically representing the user. In M2M apps that use client credentials this represents the application.

  • iss: The issuer of the token, which is the tenant of WSO2 Identity Server that acts as the authorization server.

  • aud: The audience for the token.

  • client_id: The identifier of the client (application) that requested the token.

  • aut: The authorized user type associated with the token.

    Can have the following values:

    • APPLICATION: Indicates that the token is authorized for an application.
    • APPLICATION_USER: Indicates that the token is authorized for a user.
  • expires_in: The duration (in seconds) for which the token is valid.

  • binding_type: Indicates the type of binding associated with the token, if applicable.

  • binding_ref: A reference identifier for the binding, if applicable.

  • subject_type: Specifies the type of subject (e.g., public or pairwise) as per OIDC specifications.

    OIDC claims are any additional claims configured in the application to be included in the access 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.

scopesarray of string

Lists the permissions or access levels granted by the access token.

AllowedOperations​

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

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

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

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 access token's claims and scopes.

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 access 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 Server

requestIdstring

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

actionTypestringYes

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

Allowed values: PRE_ISSUE_ACCESS_TOKEN

eventEventYes

Defines the context data related to the pre issue access 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 access token's claims and scopes.

RequestHeaders​

Type: object

2 properties
NameTypeRequiredDescription
namestringYes
valuearray of stringYes

RequestParams​

Type: object

2 properties
NameTypeRequiredDescription
namestringYes
valuearray of stringYes

AccessTokenClaims​

Type: object

2 properties
NameTypeRequiredDescription
namestring
valueone of: string, integer, boolean, array of string

addOperationResponse​

Type: object

Defines the add operation.

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.

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.

valuestringYes

Defines the value for the replace operation.

removeOperationResponse​

Type: object

Defines the remove operation.

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 stringYes

Was this page helpful?