Access Tokens
The OpenID Connect Provider from BankID provides by default Access Tokens with claims as shown in the below table. The origin column indicates non-standard claims. Such claims are either added by Keycloack or the result of customization made by the OIDC Provider from BankID.
The default access token structure builds on Keycloack and consists of the following three parts:
- A General part telling that the supported token type corresponds to standard Bearer Token usage
- An ID part that contains key claims from the corresponding ID Token
- An Access part that contains details on resource access, including in particular the audience (
aud
) for the access token.
The supported default token type is self-contained since it contains enough information to determine the authorization context, in particular the following:
- The issuer (
iss)
of the access token. See corresponding claim in ID Token. - The authorized party (
azp
) for the access token. See corresponding claim in ID Token. - The subject identifier (
sub)
of the access token, ie. a reference to the end-user (resource owner) that authorized the access token. See corresponding claim in ID Token. - Intended audience (
aud)
for the access token, ie. a reference to Value-Added Services (VAS) that the access token regulates access to. Note that this is not related to the corresponding claim in the ID Token. The audience for the ID Token (being the OIDC Client) is different from the audience for an Access Token (being the VAS in question). - The specific set of resources that the access token grants access to, corresponding to the set of scopes included in the Authorize request that subsequently resulted in the issuance of the Access Token.
See session handling for the life-time of an access token. To cater for access tokens that are either revoked before their expiry, or that have expired prematurely for other reasons, validation of access tokens via Introspect is supported. Another use of introspection is for eligible resource servers to retrive confidential claims that are not carried in the access token itself. One such examle is the bankid_altsub
claim.
Note finally that the OIDC Provider form BankID supports signed Access Tokens in JWT format. The below table shows claims in the payload part of the JWT. Claims contained in the JWT header are not shown.
Claim | Origin | Scope | Example | Description | Comment |
---|---|---|---|---|---|
General part | |||||
typ | Keycloack | openid | Bearer | Token type | Always Bearer for Access Tokens |
allowed-origins | Keycloack | openid | [ ] | Not in use by the OIDC Provider from BankID | |
ID part | |||||
acr | Standard | openid | 4 | See ID Token | |
amr | Standard | openid | BID | See ID Token | |
auth_time | Standard | openid | 1510497762 | See ID Token | |
azp | Standard | openid | oidc_testclient | See ID Token | |
bankid_altsub | Custom | openid | 9578-5999-4-1765512 | See ID Token | |
exp | Standard | openid | 1510498063 | See session handling | |
iat | Standard | openid | 1510497763 | See session handling | |
iss | Standard | openid | <oidc-baseurl> | See ID Token | |
jti | Standard | openid | 7f22fd6a-3d46-4d5a-ae56-6de3c53e1873 | See ID Token | |
nbf | Standard | openid | 0 | See ID Token | |
nonce | Standard | openid | <random value> | See ID Token | |
session_state | Keycloack | openid | abf823c2-9810-4133-9369-7bff1223d6c1 | See ID Token | |
sub | Standard | openid |
| See ID Token | |
birthdate | Standard | openid | 1966-12-18 | See ID Token | |
family_name | Standard | profile | Nilsen | See ID Token | |
given_name | Standard | profile | Frode Beckmann | See ID Token | |
name | Standard | profile | Nilsen, Frode Beckmann | See ID Token | |
preferred_username | Standard | profile | Nilsen, Frode Beckmann | See ID Token | |
Access part | |||||
aud | Standard | openid | tinfo | Audience | List of VAS-names for which the access token in question is intended |
realm_access | Keycloack |
| {"roles:["profile","address","phone","email","nnin_altsub","nnin"]}
| Resource access designator at the OIDC platform level. |
|
resource_access | Keycloack |
| {"tinfo:{"roles ["address","phone_number", "email", "nnin"]}} | Resource access designator for the TINFO Service |