Identification request and response in the OIDC interface
In an identification request, the e-service directs the user's browser to the authorization endpoint of Suomi.fi e-Identification for identification. The request is made through the browser (front-channel), unlike the token request following it, which is made from one server to another.
A signed request object is used in the identification request instead of sending the parameters of the request directly as plaintext query parameters. This is done to verify that the identification request has come from the e-service.
Prerequisites to be met before making an identification request:
- The e-service has an asymmetrical key pair for signing the signed request object.
- The metadata of the e-service has been registered in the Service Management of Suomi.fi e-Identification.
- The e-service has generated single-use state and nonce values and saved them to the user’s session.
The identification request is sent to the authorization endpoint, which has been specified in the OIDC metadata of Suomi.fi e-Identification.
In the test environment, the metadata can be found at https://testi.apro.tunnistus.fi/.well-known/openid-configuration
In production, the metadata can be found at https://tunnistautuminen.suomi.fi/.well-known/openid-configuration
Name of http query parameter | Parameter value example | Description |
|---|---|---|
request | eyJraWQiOiJzaWdfRUNfa2 | The identification request as a signed JWT identifier. The request parameter includes a Base64url-coded and signed JWT identifier, in which the actual parameters of the request are. Some parameters (such as scope, response_type) are also repeated in the request in plaintext for interoperability reasons. However, Suomi.fi e-Identification processes and validates the content of the request parameter. |
ui_locales | fi | The language of the user interface. Possible values: fi, sv, en, smn, sms, se |
scope | openid eidas | Scope is used to specify what data on the user is wanted. The metadata of the e-service specifies the data that can be obtained. In the request, less data can be requested, but not more. |
response_type | code | Specifies what is returned in the response to the identification request. Suomi.fi e-Identification uses code. This means that the end user’s successful identification returns an authorization code that will be used to retrieve personal data from the token endpoint. |
redirect_uri | https://testipalvelu.apro. | The web address to which the identification response will be directed. The address must be one of the addresses specified in the e-service metadata. |
state | 3TBh2ffZ944nesVh1euam | A value that is returned as such to the redirect uri of the response. Can be used in preventing a CSRF attack by saving it as an encrypted browser cookie and verifying it in the response. |
nonce | wQolTZk8KWl-1ye92RnIrH | A value that is returned as such in the token response. Can be used to link the user identification request and the token response with each other and to prevent replay attacks. |
client_id | tunnistus_testipalvelu | The unique identifier of the e-service. This must be the same as in the e-service metadata. |
Header
{ "kid": "sig_EC_key_2026-06-24", "typ": "JWT", "alg": "ES256"}Parameter name | Parameter value example | Description |
|---|---|---|
kid | sig_EC_key_2026-06-24 | The identifier of the key (key ID), has been used to sign the identification request |
typ | JWT | Indicates that the content (payload) is in JSON Web Token (JWT) format. |
alg | ES256 | The signing algorithm of the identification request. Possible values: RS256, RS512, ES256, PS256, PS512 |
Sisältö (Payload)
{
"iss": "tunnistus_testipalvelu",
"response_type": "code",
"nonce": "wQolTZk8KWl-1ye92RnIrHMoIjqRIyZXNbojtiH6NIs",
"client_id": "tunnistus_testipalvelu",
"aud": [
"https://testi.apro.tunnistus.fi/", "https://testi.apro.tunnistus.fi/idp/profile/oidc/authorize"
],
"nbf": 1782305869,
"ui_locales": "fi",
"scope": "openid eidas finnishauthenticator names domesticaddress municipality foreignaddress protectionorder mail finnishcitizenship",
"redirect_uri": "https://testipalvelu.apro.tunnistus.fi/oidc/callback",
"state": "3TBh2ffZ944nesVh1euamUKbJaPat007aWate6aix2Q",
"exp": 1782305879,
"iat": 1782305879,
"jti": "02533ac8-ace6-41a2-b189-bf4e64d40214"
}
Parameter name | Parameter value example | Description |
|---|---|---|
iss | tunnistus_testipalvelu | The identifier of the JWT generator, same as the unique identifier of the e-service. |
response_type | code | Specifies what is returned in the response to the identification request. Suomi.fi e-Identification uses code. This means that the end user’s successful identification returns an authorization code that will be used to retrieve personal data from the token endpoint. |
nonce | wQolTZk8KWl-1ye92RnIrH | A single-use identifier that can be used to link an identification request and a token response with each other. This is done to prevent replay attacks related to reuse of the request. |
client_id | tunnistus_testipalvelu | The unique identifier of the e-service. This must be the same as in the e-service metadata. |
aud | [ "https://testi.apro.tunnistus.fi/", | Specifies to which web address this identification request has been addressed. Must contain the address of the authorization endpoint of Suomi.fi e-Identification. |
nbf | 1782305869 | The time point when the JWT identifier became valid. Seconds since 1970-01-01T00:00:00Z UTC. |
ui_locales | fi | The language of the user interface. Possible values: fi, sv, en, smn, sms, se |
scope | openid eidas | Scope is used to specify what data on the user is wanted. The metadata of the e-service specifies the data that can be obtained. In the request, less data can be requested, but not more. |
redirect_uri | https://testipalvelu.apro. | The web address to which the identification response will be directed. The address must be one of the addresses specified in the e-service metadata. |
state | 3TBh2ffZ944nesVh1euam | A value that is returned as such to the redirect uri of the response. Can be used in preventing a CSRF attack by saving it as an encrypted browser cookie and verifying it in the response. |
exp | 1782305879 | The time point when the validity of the JWT identifier ends. Seconds since 1970-01-01T00:00:00Z UTC. |
iat | 1782305869 | The time point when the JWT identifier was generated. Seconds since 1970-01-01T00:00:00Z UTC. |
jti | 02533ac8-ace6-41a2-b189- | The unique ID of the JWT identifier |
The following matters must be taken into account in the e-service when generating the identification request and processing the response:
- The state value must be cryptographically strong and sufficiently long (at least 32 bytes) so that it cannot be guessed. The value is saved to the user's session before redirection and verified from the response before further processing.
- The nonce value must also be saved to the session and compared to the nonce value of the token response.
- The redirect_uri must be predefined in the e-service metadata and it must be the same as the address used in the identification request. Suomi.fi e-Identification does not direct the response to any other addresses.
- The exp time of the request object (request parameter) must be short (e.g., a few minutes) so that the identification request cannot be reused.
For more information on the nonce claim of a token response, go to page Token request and response in the OIDC interfaceOpens in a new window..
A missing or incorrect verification of the state value exposes the e-service to CSRF attacks (Cross-Site Request Forgery), in which the attacker can trick the user's session to the identification event of another user.
The response will be returned to the redirect_uri specified in the identification request. The content of an identification response is described in the table below.
Name of http query parameter | Parameter value example | Description |
|---|---|---|
code | AAhzZWNyZXQ3MkMGUZp | A short-term code that the e-service must transmit to the token endpoint of Suomi.fi e-Identification. |
state | 3TBh2ffZ944nesVh1euam | A value that was in the original identification request. |
Errors
If the identification request fails or the user discontinues identification, the user is directed back to redirect_uri with error parameters in accordance with the Oauth2 standard (RFC 6749):
https://asiointipalvelu.fi/callback?error=access_denied&error_description=...&state=...
The most common error codes can be found on the page Error codes in the OIDC interface. The e-service must always verity the state parameter of the response even in the event of an error. The verification must be carried out before the error is displayed to the user.
Next steps
After the e-service has received the authorization code (code) and verified that the state value of the response matches the original request, the next step is to replace the code with personal data through the token interface. See the Token request and response page.