OIDC Token Authentication Connector Configuration Values
Configuration Values
The following configuration values can be defined while configuring OIDC Token Authentication Connector on the Call Transformation page:
| Field name | Type | Field Value | Required/Optional | Description |
|---|---|---|---|---|
| Processing Adapter | String | com.mashery.proxy.customer.generic.oidc-token-connector | Required | Adapter used to validate OpenID Connect tokens and fetch user information from the UserInfo endpoint. |
| Perform Pre-processing | Boolean | Enabled | Optional | When enabled for pre-processing, validates the pre-processing logic before forwarding the request to the backend. |
| Data to make available for pre-processing | Map | — | Optional | Specifies the input data made available for pre-processing. |
| Map | userinfo_endpoint: { regionCodeHeader: <Header parameter name that holds region code> regionCodeValue: {"<region1 code>":"<user info endpoint URI for region1>", "<region2 code>":"<user info endpoint URI for region2>", "<region3 code>":"<user info endpoint URI for region3>"} defaultURI: < default user info endpoint URI> } | Required | The URI for the UserInfo endpoint can be selected conditionally based on metadata present in the API request header. - - Note: - If the - | |
| Map | inject_headers: {"<HEADER1_NAME>":"<JSONPathExpression>","<HEADER2_NAME>":"<JSONPathExpression>",..} inject_headers:{ "<HEADER1_NAME>":"<JSONPathExpression>","<HEADER2_NAME>":"<JSONPathExpression>" }, ... } | Optional | Key:value pairs used to inject headers from the JSON response returned by the UserInfo endpoint after successful validation. Values are matched using JSONPath expressions. Headers are injected only when the configured value exists in the response. Header values must support UTF-8 encoding to handle international characters, for example, | |
| Boolean | block_authorization_header:<true/false> | Optional | Default is true. Note: This setting applies only to an access token that needs to be blocked or forwarded to the resource server. | |
| String | error_metadata_location : <Error response meta data location> | Optional | Specifies the location of the error response to be returned in case of an error. Possible values are ResponsePayload and ResponseHeaders. | |
| String | error_header_name : <Response header name> | Optional | Name of the response header that contains the error message. | |
| String | error_payload_location:<JSONPath Expression> | Optional | JSONPath expression to retrieve error information from the OpenID error response payload. The value retrieved is set as the HTTP response body. | |
| String | http_proxy_server : <string> | Optional | Proxy server used to retrieve the userinfo_endpoint. Only one third-party proxy server per endpoint is supported. | |
| Integer | http_proxy_port : <integer> | Optional | The proxy server port to retrieve the userinfo_endpoint. | |
| Boolean | enable_error_set:<true/false> | Optional | Default is When set to When set to any value other than |
Examples
Data to make available for pre-processing
The following are example values for Data to make available for pre-processing field.
Configuration parameters for UserInfo endpoint
userinfo_endpoint: {
regionCodeHeader:HTTP-REQUEST-REGION-KEY
regionCodeValue: {"FR":"https://uki.acme-travel.com:9001/fr/userinfo",
"US":"https://uki.acme-travel.com:9001/en/userinfo",
"DE":"https://uki.acme-travel.com:9001/de/userinfo"}
defaultURI: https://uki.acme-travel.com/en/userinfo
}
Configuration parameters for Header injection
inject_headers:{
"US": {
"X-User-Email": "$.uid",
"X-Unit-Id": "$.b2bUnitId",
"X-Account-Number": "$.erpAccountNumber"
},
"default": {
"X-User-Id": "$.email",
"X-Unit-Id": "$.b2bUnitId",
"X-Account-Number": "$.erpAccountNumber"
}
}
Configuration parameters for Error handling
block_authorization_header : false
error_metadata_location : ResponseHeaders
error_header_name : WWW-Authenticate
error_payload_location: $.errorMessage
Configuration parameters for Proxy settings
http_proxy_server : squid.example.com
http_proxy_port : 3128
enable_error_set : true
Sample Example: Geo Distributed Authorization Endpoint Explanation
-
The following pre-input configuration states the name of the header to fetch from the incoming API request, which holds the region code:
Syntax
regionCodeHeader:<HTTP header name that holds the region code for user info endpoint>Example
regionCodeHeader:HTTP-REQUEST-REGION-KEY -
The following pre-input configuration holds the details of the region code and the UserInfo endpoint URI association. The region code header value is matched with the configured value specified for
regionCodeValuepre-input.Syntax
regionCodeValue: {<Code1>:<user info Endpoint1>, <Code2>:<user info Endpoint2> ......}Example
regionCodeValue:{
"FR":"https://uki.acme-travel.com:9001/fr/userinfo",
"US":"https://uki.acme-travel.com:9001/en/userinfo",
"DE":"https://uki.acme-travel.com:9001/de/userinfo"
}If the incoming header in the request
HTTP-REQUEST-REGION-KEYhas the value 'FR', the configuration maps to the introspection endpoint URI 'https://uki.acme-travel.com:9001/fr/userinfo'. -
The following pre-input configuration specifies the default URI of the UserInfo endpoint if
regionCodeHeaderis missing or has an empty value in the request.Syntax
defaultURI:<Contains the default UserInfo endpoint>Example
defaultURI:https://uki.acme-travel.com/en/userinfo
Sample Example
-
API Request to public endpoint configured in Cloud API Management (Control Center): https://api.acme.com/aladdapi
-
API Inbound Region Code Header:
HTTP-REQUEST-REGION-KEY:FR -
Data to make available for pre-processing (Normal flow)
regionCodeHeader: HTTP-REQUEST-REGION-KEY
regionCodeValue: {"FR":"https://uki.acme-travel.com:9001/fr/userinfo",
"US": "https://uki.acme-travel.com:9001/en/userinfo",
"DE": "https://uki.acme-travel.com:9001/de/userinfo"}
defaultURI: https://uki.acme-travel.com/en/userinfo
Sample curl call without region code header
curl -i -v -H 'Host:localapi.localproxy.mashery.com' 'http://localhost:8080/aladdapi?api_key=key'
In this case API request is sent to the UserInfo endpoint "https://uki.acme-travel.com/en/userinfo" for OIDC token validation.
Sample curl call with region code header
curl -i -v -H 'Host:localapi.localproxy.mashery.com' 'http://localhost:8080/aladdapi?api_key=key' -H 'HTTP-REQUEST-REGION-KEY:FR'
In this case API request is sent to the UserInfo endpoint "https://uki.acme-travel.com:9001/fr/userinfo" for OIDC token validation.
Configuration Steps
Refer to the Configuring Call Transformation for an Endpoint for more information on the configuration steps.