API contract to implement
The API contract for pre-issue access 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"
OAuth2: oauth2
clientCredentials flow, token URL https://example.com/oauth/token
1 scopes
| Scope | Description |
|---|---|
process | process request generate response |
Other
handle pre-issue access token events
POST /
Request body (required): application/json
Schema: RequestBody
5 properties
| Name | Type | Required | Description |
|---|---|---|---|
flowId | string | A unique identifier that associates with the token issuing flow in WSO2 Identity Server. | |
requestId | string | A unique correlation identifier that associates with the token request received by WSO2 Identity Server. | |
actionType | string | Yes | Specifies the action being triggered, which in this case is PRE_ISSUE_ACCESS_TOKEN. Allowed values: |
event | Event | Yes | 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. |
allowedOperations | AllowedOperations | Yes | Defines the set of operations that your external service is permitted to perform on the access token's claims and scopes. |
Responses
| Code | Description | Schema |
|---|---|---|
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
| Name | Type | Required | Description |
|---|---|---|---|
request | Request | Yes | Any additional parameters included in the access token request. These may be custom parameters defined by the client or necessary for specific flows. 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. |
tenant | Tenant | Yes | This property represents the tenant under which the token request is being processed. |
user | User | Contains information about the authenticated user associated with the token request. | |
userStore | UserStore | Indicates the user store in which the user's data is being managed. | |
accessToken | AccessToken | Yes | 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. 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
| Name | Type | Required | Description |
|---|---|---|---|
grantType | string | Yes | 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. |
clientId | string | Yes | The unique identifier of the client (application) that is requesting the access token. |
scopes | array 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. | |
additionalHeaders | array of RequestHeaders | Any additional HTTP headers included in the access token request. These may contain custom information or metadata that the client has sent. 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. | |
additionalParams | array of RequestParams |
Tenant
Type: object
This property represents the tenant under which the token request is being processed.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The unique numeric identifier of the tenant. |
name | string | Yes | The domain name of the tenant. |
User
Type: object
Contains information about the authenticated user associated with the token request.
1 property
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | 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
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The unique identifier for the user store. |
name | string | Yes | 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
| Name | Type | Required | Description |
|---|---|---|---|
tokenType | string | Yes | Defines the type of token. Allowed values: |
claims | array of AccessTokenClaims | Yes | 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:
|
scopes | array 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
| Name | Type | Required | Description |
|---|---|---|---|
op | string | Yes | Allowed values: |
paths | array of string | Yes |
replaceOperation
Type: object
Defines the replace operation.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
op | string | Yes | Allowed values: |
paths | array of string | Yes |
removeOperation
Type: object
Defines the remove operation.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
op | string | Yes | Allowed values: |
paths | array of string | Yes |
SuccessResponse
Type: object
Defines the success response.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
actionStatus | string | Yes | Allowed values: |
operations | array 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
| Name | Type | Required | Description |
|---|---|---|---|
actionStatus | string | Yes | Indicates the outcome of the request. For a failed operation, this should be set to FAILED. Allowed values: |
failureReason | string | Yes | Provides the reason for failing to issue an access token. |
failureDescription | string | Yes | 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
| Name | Type | Required | Description |
|---|---|---|---|
actionStatus | string | Yes | Indicates the outcome of the request. For an error operation, this should be set to ERROR. Allowed values: |
errorMessage | string | Yes | The cause of the error. |
errorDescription | string | Yes | A detailed description of the error. |
RequestBody
Type: object
5 properties
| Name | Type | Required | Description |
|---|---|---|---|
flowId | string | A unique identifier that associates with the token issuing flow in WSO2 Identity Server. | |
requestId | string | A unique correlation identifier that associates with the token request received by WSO2 Identity Server. | |
actionType | string | Yes | Specifies the action being triggered, which in this case is PRE_ISSUE_ACCESS_TOKEN. Allowed values: |
event | Event | Yes | 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. |
allowedOperations | AllowedOperations | Yes | 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
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
value | array of string | Yes |
RequestParams
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
value | array of string | Yes |
AccessTokenClaims
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ||
value | one of: string, integer, boolean, array of string |
addOperationResponse
Type: object
Defines the add operation.
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
op | string | Yes | Allowed values: |
path | string | Yes | Defines the path for the add operation. Should be one from the allowed paths of |
value | one of: string, CustomValue | Yes | Defines the value for the add operation. |
replaceOperationResponse
Type: object
Defines the replace operation.
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
op | string | Yes | Allowed values: |
path | string | Yes | Defines the path for the replace operation. Should be one from the allowed paths of |
value | string | Yes | Defines the value for the replace operation. |
removeOperationResponse
Type: object
Defines the remove operation.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
op | string | Yes | Allowed values: |
path | string | Yes | Defines the path for the remove operation. Should be one from the allowed paths of |
CustomValue
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
value | one of: string, integer, boolean, array of string | Yes |
Was this page helpful?