X-UserContext HTTP Header (MV-SIPN only)
For API services consumed through MV-SIPN, Swift API Gateway will establish a session with API provider. After successfully establishing the session, Swift API Gateway will create X-UserContext HTTP header and forward this header to the API service. This header contains a signed JWT token including information about the API consumer. The signed JWT token contains the following headers and claims.
| Headers | Descriptions |
|---|---|
| typ | Type. It is JWT. |
| alg | Algorithm. This parameter defines the signing algorithm used for the JWT. It is RS256. |
| x5c | This parameter is the Swift API Gateway's public certificate for verifying the JWT. |
| Claims | Descriptions |
|---|---|
| iss | Issuer. This is the issuer of the token. https://api.swiftnet.sipn.swift.com for Live environment and https://api-test.swiftnet.sipn.swift.com for Pilot environment. |
| sub | Subject. Swift API Gateway will use Application Security. |
| aud | Audience. This is the audience of the token. It should contain the URI of the API service URL provided by the API Provider. For example, https://gss-screening-api-pilot.swiftnet.sipn.swift.com/v1/transaction for the pilot environment, https://gss-screening-api.swiftnet.sipn.swift.com/v1/transaction for the Live environment. |
| iat | Issued at. This is the token creation timestamp in NumericDate (number of seconds from 1970-01-01T00:00:00Z UTC). It should be no more than 15 minutes before the expiration time defined in the exp claim. |
| exp | Expiration time. This is the token expiration timestamp in NumericDate (number of seconds from 1970-01-01T00:00:00Z UTC). It should be no more than 15 minutes after the token creation time defined in iat claim. |
| jti | JWT ID. This is the unique identifier for the JWT used to detect duplicates. The value should contain the issuer, issue time, plus a value unique within the valid timeframe (15 minutes) of the token. |
| userName | This is the subject DN of the API consumer's Swift-issued certificate used to establish session with Swift API Gateway. |
| consumerKey | This is the consumer-key of the API consumer's application created on Swift Developer Portal. |
| expiresIn | This is the expiration time of OAuth 2.0 token issued by Swift Authorization Server to the API consumer. |
| requesterBIC | This is the BIC of the API consumer who is registered for your API service. |
Example (before encoding):
{
"iss": "https://api-test.swiftnet.sipn.swift.com",
“sub”: “Application Security”,
“aud” : “https://gss-screening-api-pilot.swiftnet.sipn.swift.com/v1/transaction”,
"exp": “1300819380”,
“iat”: “1300819080,
“jti” : “lWuVIjnqOgX3ZbG2OyjXQLq1Xzmm2CjY_1300819080_12345”,
"userName": "cn=john-doe,o=bnpafrp,o=swift",
"consumerKey": “06YU9gYhoKFGShvNFq28BIXCMiu0RBty”,
“expiresIn”: “1320819380”
“requesterBIC”: “bnpafrpp”
}Previous page Session Distribution
Next pageDeveloper Tools