About tokens

In general a token is just some piece of data. In the Unit4 Identity Services (U4IDS) tokens are used for authentication and authorization.

The token contains enough information to identify the user or the resource and is used to prove identity. You can think of it as a set of attributes/claims about a resource (see also claims). This requires that a token must be protected so that the token cannot be altered by unauthorized people. A token can have different formats and there are different types to serve different purposes.

The client does not need to know anything about the content or structure of the token itself. However, there is still a large amount of metadata that may be attached to a token, such as its current validity, approved scopes, and information about the context in which the token was issued. These pieces of information are often vital to the client to make authorization decisions based on the tokens being presented and for validation of the token.

When the client gets a token from U4IDS it can come in two forms:

Token type Explanation
Self-contained JWT token: Sometimes also referred to as a value token, the self-contained token contains the intrinsic value.
Reference token: Reference tokens are just identifiers for a token.

For more information about token types used in U4IDS, see OpenID Connect.

Example of a self-contained JSON Web Token (JWT)

The token issued by U4IDS has three parts

Token part Content
Header: Contains information used to validate the token, such as the token type, signature algorithm, and signature key.
Payload: The attributes/claims connected to a user or resource.
Signature: The signature is a hashed value of the header and payload. The signature is used to validate the authenticity and integrity of the token. The token is signed with an X509 certificate.

A representation of a JWT access token is shown below. The token will be a base64 encoded string. The three parts are separated with a period (.).

Example of a JWT access token

The encoded token string: 


The decoded token string:
// The header
// The payload
    "aud":"", // for ID Token this value will be the clientId
    "scope":"openid resourcescope",
    "unit4_id":"the user name",
// The signature
�4��    �N�[�w�+�g��t��>�M7�W������'��箦���q��#_{%�L1�,�����    |�(���