- policyRef: name: oauth2-token-introspection-flex config: introspection_url: <string> // REQUIRED authorization_value: <string> // REQUIRED validated_token_ttl: <number> // OPTIONAL authentication_timeout: <number> // OPTIONAL skip_client_id_validation: <boolean> // REQUIRED consumer_by: <string> // REQUIRED expose_headers: <boolean> // OPTIONAL scopes: <string> // OPTIONAL scope_validation_criteria: <string> // OPTIONAL max_cache_entries: <number> // OPTIONAL
OAuth 2.0 Token Introspection Policy
Policy Name |
OAuth 2.0 Token Introspection Policy |
Summary |
Allows access only to authorized client applications |
Category |
Security |
First Flex Gateway version available |
v1.3.0 |
Returned Status Codes |
400 - Invalid token |
401 - Unauthorized access or error when connecting to the authorization server |
|
403 - Forbidden, invalid client application credentials |
|
500 - Bad response from authorization server, or WSDL SOAP fault error |
Summary
The OAuth 2.0 Token Introspection policy enables you to configure OAuth 2.0 using any third-party Identify Provider (IdP), such as Okta, AWS, Azure or Google Cloud Platform. The policy allows for tokens based on the OAuth 2.0 Authorization Framework to be authorized without having to register an external IdP server in the Anypoint Platform.
The policy validates the token sent by the client to the protected API, and allows access to the backend server only if the introspection endpoint authorizes the token.
Configuring Policy Parameters
Flex Gateway
To apply OAuth 2.0 token introspection when using Flex Gateway as your runtime, you must manually configure the policy in a YAML configuration file. Refer to the following policy definition and table of parameters:
Parameter | Required or Optional | Default Value | Description |
---|---|---|---|
|
Required |
The third-party token introspection URL |
|
|
Required |
The method to request authorization from the authentication service. Specify either a Basic Auth string with |
|
|
Optional |
600 |
The caching limit for the validated token |
|
Optional |
10000 |
The timeout when sending data to the authentication service |
|
Required |
false |
Enables/disables client ID enforcement support |
|
Required |
Associate an identity provider’s |
|
|
Optional |
false |
|
|
Optional |
"" |
A space-delimited list |
|
Optional |
"AND" |
The criteria to apply to the |
|
Optional |
1000 |
Resource Configuration Example
- policyRef:
name: oauth2-token-introspection-flex
config:
introspection_url: https://my-introspection.com/introspect
authorization_value: Basic am9obkBleGFtcGxlLmNvbTphYmMxMjM=
validated_token_ttl: 600
authentication_timeout: 10000
skip_client_id_validation: false
consumer_by: "client_id"
expose_headers: true
scopes: "profile email shopping"
scope_validation_criteria: "AND"
max_cache_entries: 1000