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.

Note that access tokens for the Client Credential Grant have a different structure for the ID part since there is no ID Token involved in that case.

Note that the OIDC Provider from BankID currently supports multi-audience tokens. If an OIDC Client requests a set of scopes that affect several value-added services (VAS), each of the affected services will be listed in the aud claim of the access token.

This practise may be changed in a future release of the OIDC Provider from BankID by imposing a restriction to not allow requests for a set of scopes that affect more than one VAS in each request. Introducing such a single-audience restriction has the benefit of giving tighter control since a bearer token in wrong hands gives access to fewer resources. The downside of a single-audience restriction is that integration becomes more complex for OIDC clients since multiple requests must be made, one for each set of requested scopes, to get a series of access tokens, one for each affected VAS.

To be prepared for a possible future change from multi-audience access tokens to single-audience access tokens, OIDC Clients are recommened to not include a set of scopes in the same request that affects more that one VAS. The recommended integration practise is to use a series of subsequent requests for access tokens to separate VAS. Using this recommended integration practise will not break backwards compatibility if a single-audience restriction is introduced. For authentication flows involving the end-user subsequent requests can be made via the id_token_hint option for the Authorize endpoint to avoid repeated authentication of the end-user.

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.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.

ClaimOriginScopeExampleDescriptionComment
General part
typKeycloacknone requiredBearerToken typeAlways Bearer for Access Tokens
allowed-originsKeycloacknone required
[ ]Not in use by the OIDC Provider from BankID
ID part
acrStandardnone required
4See ID Token
amrStandardnone required
BIDSee ID Token 
auth_timeStandardnone required1510497762See ID Token 
azpStandardnone requiredoidc_testclientSee ID Token 
bankid_altsubCustomnone required9578-5999-4-1765512See ID Token 
expStandardnone required1510498063See session handling 
iatStandardnone required1510497763See session handling 
issStandardnone required<oidc-baseurl>See ID Token 
jtiStandardnone required7f22fd6a-3d46-4d5a-ae56-6de3c53e1873See ID Token 
nbfStandardnone required0See ID Token 
nonceStandardnone required<random value>See ID Token 
session_stateKeycloacknone requiredabf823c2-9810-4133-9369-7bff1223d6c1See ID Token 
subStandardnone required

e8c523ff-52a2-42e2-a7a5-f1d0fbb76204

See ID Token 
birthdateStandardnone required1966-12-18See ID Token 
family_nameStandardprofileNilsenSee ID Token 
given_nameStandardprofileFrode BeckmannSee ID Token 
nameStandardprofileNilsen, Frode BeckmannSee ID Token 
preferred_usernameStandardprofileNilsen, Frode BeckmannSee ID Token 
Access part
audStandardnone required
tinfoAudienceList of VAS-names for which the access token in question is intended
realm_accessKeycloack

profile
address
phone
email nnin_altsub
nnin

{"roles:["profile","address","phone","email","nnin_altsub","nnin"]}

 

Resource access designator at the OIDC platform level.

 

resource_access
Keycloack

profile
address
phone
email
nnin

 

{"tinfo:{"roles ["address","phone_number", "email", "nnin"]}}
Resource access designator for the TINFO Service
  • No labels