Suomi.fi for Service Developers
Go directly to contents.

Technical interface description (SAML)

General technical characteristics of the service

The API is using SAML 2.0. Messages are deflated and Base64 encoded before they are transmitted.

Technical connection

The e-service is connected to the Identification service by submitting the basic information (metadata) to the Identification Administration. Familiarize yourself with the e-service's metadata in the Identification service.

The Identification service and the e-service sign the SAML 2.0 messages they send, so to ensure the origin, the recipient must have the sender's public key (in the certificate). In connection with the connection, the Identification Certificate is uploaded to the e-service server. The e-service's certificate is communicated to the Identification as part of the e-service's basic information (metadata).

The exchange of SAML-messages

SAML messages between the Identification service and the e-service go through the end-user's browser with the HTTP standard commands GET and POST. The standard SAML 2.0 determines, how the SAML message is conveyed in the respective HTTP command.

The e-service calls the Identification service to send an identification request message containing a return address to the end-user's browser with the GET or POST command. The Identification service allows the end user to identify themselves in any way. The Identification service sends a response message to the e-service's return address with the POST command. The assertions in the response message are encrypted with symmetric encryption, where the encryption key is asymmetrically encrypted with the public key found in the service’s metadata.

Message traffic is encrypted with TLS, ie. all calls and response messages are transmitted via HTTPS connection. The e-service should ensure that all connections between the end-user's browser and the e-service are HTTPS encrypted.

The part of the response message containing personal data is encrypted with symmetric encryption, where the encryption key is asymmetrically encrypted with the public key found in the e-service’s metadata. The e-service service must define the key used for encryption in its metadata with the purpose “encryption” or by leaving the key’s purpose undefined.

The Identification service is called over an HTTPS connection. The return address provided by the e-service in its message shall utilize the HTTPS protocol.

All SAML messages are signed to ensure the sender, the integrity and the immutability of the message. The parties shall check the signing of the messages they receive.

Testing

It is easier to connect to the Identification service if you have access to a tool that opens SAML messages. There are extensions for the browsers, such as "SAML tracer" for Firefox, "SAML Chrome Panel" and "SAML Message Decoder" for Chrome.

Identification

The identification of the end-user in the Suomi.fi-identification is a SSO login to all the e-services linked to the Suomi.fi-identification.

An example of an identification event

Picture 2. An example of an identification event.

  • The e-service notices that the end user has not been identified.
  • The e-service directs the end user to the Identification service and sends a SAML request for identification to the browser.
  • The end-user browser forwards the SAML identification request to the Identification service.
  • The Identification service receives the SAML request for identification and returns to the browser a page where identification tools can be selected.
  • The end user selects the desired identification method and identifies.
  • The provider of the identification tool directs the browser back to Suomi.fi-identification.
  • The browser communicates the identification tool to  to Suomi.fi-identification along with the end user identification code provided by the provider.
  • to Suomi.fi-identification creates a SSO session and creates a SAML message that contains the end-user information and communicates the message to the browser while  to Suomi.fi-identification directs the browser back to the e-service.
  • The browser communicates the personal information contained in the SAML identification response to the e-service, which initiates a session for the identified end user.
  • The e-service returns the protected resource to the end user as requested.

The e-service can create the authentication request, for example by providing the browser with an HTML form that contains a SAML message in the hidden fields. The form can send a script that is executed automatically or the end user sends it by clicking the form's submit button.

... 
<form name=”APRO” method=”POST” action= ”https://testi.apro.tunnistus.fi/idp/profile/SAML2/POST/SSO">
<input type=”hidden” name=”SAMLRequest” value=”fZJBU8I...”/>
<input type=”hidden” name=”RelayState” value=”ss%3Amem%3Ac3”/>
<input type=”hidden” name=”SigAlg” value”=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256”/>
<input type=”hidden” name=”Signature” value=”sO%2Fw..”/>
</form>
...
var form = document.APRO;
form.submit();
...
<input type="submit" value="Siirry tunnistautumaan">

In the examples below, the following name definitions used throughout SAML 2.0 messages are used to convey data content.

xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"

Authentication request

The information that controls the identification request is defined in the basic information (metadata) that the e-service provided to the Identification when connected to the service.

By customizing the content of the authentication request, you can influence the user interface visible to the user and the response message. For example, in the authentication request, you can choose the language that Suomi.fi-identification should use in its interface, which authentication methods are shown to the end user, and where the user’s browser is directed after the authentication event.

Supported bindings are HTTP POST and HTTP REDIRECT.

The identification request must be signed (using at least the SHA256 level algorithm).

e-service identity

Description

E-service code. Refers to the EntityID attribute defined in the e-service metadata.

Based on the code, the Identification finds the definitions of the e-service, including a certificate that can be used to secure the origin of the message.

Placement

saml2p:AuthnRequest -elements saml2:issuer-element

Format

Character string, length max 1024 characters.

URL format.

Madatory

Yes

Example

<saml2p:AuthnRequest …>
…
<saml2:Issuer>https://kalastus.kunta.fi/lupa-asiat</saml2:Issuer>

Table 1. e-service code, identification request.

Return address of the e-service

Description

The destination address of the message, i.e. the Identification address service.

Determined in the identification metadata per connection.

Placement

saml2p:AuthnRequest-elements attribute Destination.

Format

Character string

Mandatory

Yes

Example

<saml2p:AuthnRequest … Destination=”…”

Table 2. Return address, identification request

Time stamp

Description

Time when the authentication request was created.

Placement

issueInstant-attribute for element saml2p:AuthnRequest.

Format

Character string, 20 characters.

W3C XML Schema definition data type DateTime which has the format "YYYY-MM-DDThh: mm: ss".

In UTC format, without time zone.

Mandatory

Yes

Example

<saml2p:AuthnRequest… IssueInstant=”2015-09-28T16:27:36Z”…>

Table 3. Timestamp, authentication request.

User interface language

The interface language is determined by the language selection of the first authentication request in the same session. In other words, if the first service you authenticate to sets the language to Swedish, the interface language will also be Swedish when logging into another service (regardless of the language chosen for the authentication request in the subsequent services). This selection continues until you log out.

Description

User interface language.

Placement

saml2p:Extensions-element's

xmlns="urn:vetuma:SAML:2.0:extensions"-element's LG-element.

Format

Character string, 2 characters.

Language code according to the ISO 639-1 standard.

The Identification language service is Finnish (fi), Swedish (sv) and English (en).

The language code can also be passed as the variable's locale value in the HTTP protocol (similar to the event code passed in the RelayState variable).

The transmission of the language code thus only works in the HTTP-Redirect profile in such a way that it is the last query parameter.

This method should only be used if, for technical reasons, the language code cannot be included in the SAML message.

Mandatory

No

Example

<saml2p:AuthnRequest
…
<saml2p:Extensions>
<vetuma xmlns="urn:vetuma:SAML:2.0:extensions">
<LG>sv</LG>
</vetuma>
</saml2p:Extensions>

Table 4. User interface language, identification request.

The return address of the e-service or a reference to the return address

Description

The return address of the e-service or a reference to the return address

Placement

saml2p: The AuthnRequest element attribute AssertionConsumerServiceURL or attirbut AssertionConsumerServiceIndex.

The value of the AssertionConsumerServiceURL attribute must be the return address set in the e-service metadata.

Alternatively, you can refer to the e-service return address number that is determined in the metadata with the attribute AssertionConsumerServiceIndex.

Format

A URL whose protocol must be HTTPS, otherwise the Identification service will reject the message (using the Requester error code).

Mandatory

No

Example

<saml2p:AuthnRequest ...  AssertionConsumerServiceURL=”https://kalastus.kunta.fi/SAML2/POST"

or



<saml2p:AuthnRequest …
AssertionConsumerServiceIndex=”1”

Table 5. Return address of the e-service or a reference to the return address, the identification request.

Event code

Description

The event code set by the e-service that enables the preservation of the e-service's status information throughout the identification event.

For example, according to the event code, the e-service can direct the end user to the correct page after the identification.

The event code is not included in the SAML message but is communicated using the HTTP protocol.

Placement

RelayState-variable.

Format

Max 80 characters.

Mandatory

No

Example

<form method="post" action=”….
<input type="hidden" name="RelayState" value="token" />

Table 6. Event code, identification request.

Approved identification methods

Description

In the identification request, the E-service can limit the group of defined identification methods in the metadata by providing a list of permitted levels of trust and tools.

If the identification tools or levels are not listed, all the identification tools and confidence levels defined in the e-service's metadata are allowed.

Note that it is not possible to define such identification tools in the identification request that are not mentioned in the e-service's basic data (metadata). Then the processing of the identification request leads to an error (after selecting ANY option on the discovery page).

Placement

saml2:AuthnContextClassRef-element in saml2p:RequestedAuthnContext-element.

Format

String with the possible values

  • http://ftn.ficora.fi/2017/loa3
  • http://eidas.europa.eu/LoA/high
  • http://ftn.ficora.fi/2017/loa2
  • http://eidas.europa.eu/LoA/substantial
  • urn:oid:1.2.246.517.3002.110.7

In the test environment also

  • urn:oid:1.2.246.517.3002.110.999 = testi identification method

Mandatory

No

Example

In the AuthnRequest messages expressed by the elevated confidence level and tools:


<saml2p:AuthnRequest

…
<saml2p:RequestedAuthnContext
xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
Comparison="exact">
<saml2:AuthnContextClassRef>http://ftn.ficora.fi/2017/loa3</saml2:AuthnContextClassRef>
<saml2:AuthnContextClassRef>http://eidas.europa.eu/LoA/high</saml2:AuthnContextClassRef>
<saml2:AuthnContextClassRef>http://ftn.ficora.fi/2017/loa2</saml2:AuthnContextClassRef>
<saml2:AuthnContextClassRef>http://eidas.europa.eu/LoA/substantial</saml2:AuthnContextClassRef>
</saml2p:RequestedAuthnContext>

In the AuthnRequest messages expressed by the high level of trust:

<saml2p:AuthnRequest
…
<saml2p:RequestedAuthnContext
xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
Comparison="exact">
<saml2:AuthnContextClassRef>http://ftn.ficora.fi/2017/loa3</saml2:AuthnContextClassRef>
<saml2:AuthnContextClassRef>http://eidas.europa.eu/LoA/high</saml2:AuthnContextClassRef>
</saml2p:RequestedAuthnContext>

Table 7. Approved identification tools, identification request.

Processing of the code

Description

Identification of the authentication event

Placement

saml2p:NameIDPolicy-element in saml2p:AuthnRequest-element.

Format

Attribute AllowCreate and Format.

Is used with AllowCreate="true" and Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient".

Mandatory

Yes

Example

<saml2p:AuthnRequest 
…
<saml2p:NameIDPolicy AllowCreate="true"
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"/>

Table 8. Processing of the code, identification request.

Identification response

The Identification service returns, in response to the identification, the information about the identified end user. In addition to the identity, for example, the e-service can obtain the end-user's name information and updated contact information from the population data system.

The return response is encrypted. The default algorithm used for encryption is AES-GCM.

Encryption can be configured with either AES-CBC or AES-GCM algorithms. Please note that the use of AES-CBC is not recommended. The setting is defined in the Service Provider metadata registered for Suomi.fi e-identification.

  • The information communicated about an identified end-user with a Finnish identification tool
  • The information conveyed about a user who has identified himself with eIDAS

Timestamps

Description

Time when the identification response is created.

Placement

saml2p:Response-element's IssueInstant-attribut.

Format

Character string, 20 characters.

W3C XML Schema definition data type DateTime which has the format "YYYY-MM-DDThh: mm: ss".

In UTC format, without time zone.

Mandatory

Yes

Example

<saml2p:Response …
IssueInstant=”2015-09-28T16:27:36Z”

Table 9. Time stamping, identification response.

Event code

Description

The event code that the e-service sends in the identification call that enables the preservation of the e-service's status information throughout the identification event.

For example, according to the event code, the e-service can direct the end user to the correct page after the identification.

The event code is not included in the SAML message but is passed as a parameter to the HTTP command.

Placement

RelayState-parameter.

Format

Max 80 characters.

Mandatory

No

Example

<form method="post" action=”….
<input type="hidden" name="RelayState" value="token" />

Table 10. Event code, identification response.

Session identifier

Description

The single sign on session code created by the Identification service.

saml2: The NameID element contains the attribute NameQualifier (service identification code) and SPNameQualifier (e-service code) as well as Format (the definition of the code format) which, in addition to the code, must be unchanged in the logout request.

Placement

saml2:NameID-element.

Format

Text string max 1024 characters.

Mandatory

Yes

Example

<saml2p:Response …
<saml2:Assertion …
<saml2:Subject>
<saml2:NameID
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
NameQualifier="https://testi.apro.tunnistus.fi/idp1"
SPNameQualifier="https://kalastus.kunta.fi/lupa-asiat">
AAd ... dsUA==
</saml2:NameID>

Table 11. Session identifier, authentication response.

Session index

Description

Session index for SSO
Should be included in the SLO request

Placement

SessionIndex-attribute value

Format

String

Mandatory

Yes

Example

<saml2:AuthnStatement AuthnInstant="2016-05-13T11:42:42.573Z" SessionIndex="_2c41c54f41a76ec6aaeede9a9bc46a24">
<saml2:SubjectLocality Address="112.111.110.109" />
<saml2:AuthnContext>
<saml2:AuthnContextClassRef>http://ftn.ficora.fi/2017/loa2</saml2:AuthnContextClassRef>
</saml2:AuthnContext>
</saml2:AuthnStatement>

Table 12. Session index for the SSO session.

The strangth of the authentication

Description

The identification strength level

Placement

saml2:AuthnStatement-elementets saml2:AuthnContext-elements saml2:AuthnContextClassRef-element.

Format

As a value, a code is returned in URN: OID format.

  • http://ftn.ficora.fi/2017/loa3 - High level USING Finnish methods
  • http://eidas.europa.eu/LoA/high - High level USING eIDAS
  • http://ftn.ficora.fi/2017/loa2 - Substantial level USING Finnish methods
  • http://eidas.europa.eu/LoA/substantial - Substantial level USING eIDAS
  • urn:oid:1.2.246.517.3002.110.7 - Finnish Authenticator
  • urn:oid:1.2.246.517.3002.110.999 - Test method used only on TEST env.

Mandatory

Yes

Example

<saml2p:Response …
<saml2:Assertion …
<saml2:AuthnStatement …
<saml2:AuthnContext>
<saml2:AuthnContextClassRef>
http://ftn.ficora.fi/2017/loa2
</saml2:AuthnContextClassRef>

Table 13. The strength of the identification event, the identification response.

Return status

Description

The return status of the authentication request

Placement

saml2p:Response-element´s saml2p:Status-element.

Format

String.

Higher level status codes:

Success = Identification succeeded
Requester = Error in the identification request
Responder = The processing of the request for identification failed
VersionMismatch = Wrong version in the identification request.

Supplemental status codes:

AuthnFailed = Identification failed
RequestDenied = The identification tool rejected the identification.

The Status element may include the StatusMessage element containing more detailed information about the error.

Mandatory

Yes

Example

<saml2p:Response …
<saml2p:Status>
<saml2p:StatusCode
Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</saml2p:Status>

Table 14. Return status, authentication response.

Population register search successful

Description

The e-service is informed about the success of the PRS success.

Placement

saml2p:Response-elements saml2p:Status-element.

Format

String

  • true = search successful
  • false = unsuccessful search

Mandatory

Yes

Example

<saml2:Attribute Name="urn:oid:1.2.246.517.3002.111.2" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">

<saml2:AttributeValue>true</saml2:AttributeValue>

</saml2:Attribute>

Attn.

Identification when population data system is umnvailable is defined by giving the value VtjVerificationRequired the value "false" in the metadata. By default, the element is added to the metadata with the value "true".

Table 15. Status of the PRS -search.

Sign out

The image below presents the SAML messages that apply to the single log-out that is transmitted between the e-service and the Identification service when the end-user has been logged in to the e-services linked to the Identification.

Picture 3. SAML messages that move between the e-service and the Identification service during the log-out process. The messages are tranmitted via the end user's browser.

Logout request

The e-service can send a request for log-out to the Identification service or vice versa (see Figure 3). The message has the same structure in both cases.

The e-service must end the local browser session before sending the logout request to the Identification service.

Supported bindings are HTTP POST and HTTP REDIRECT.

Please note that the logout response is sent to the service that initiates the logout (In case several e-Services are logged out) only after the user clicks the "BACK TO THE E-SERVICE" link.

e-service identifier

Description

e-service identifier refers to the EntityID attribute defined in the e-service's basic data (metadata).

Based on the identifier, the service identifies the e-service's definitions, including a certificate that can be used to secure the origin of the message.

Placement

saml2p:LogoutRequest-elementets saml2:issuer-element.

Format

String, max 1024 characters.

URL-format.

Mandatory

Yes

Example

<saml2p:LogoutRequest …
<saml2:Issuer>https://kalastus.kunta.fi/lupa-asiat </saml2:Issuer>

Table 16. e-service identifier, logout.

Timestamp

Description

Time when the logout request is created

Placement

saml2p:LogoutRequest-element's IssueInstant-attribute

Format

String, 20 characters.

W3C XML Schema definition data type DateTime which has the format "YYYY-MM-DDThh: mm: ss".

In UTC format, without time zone.

Mandatory

Yes

Example

<saml2p:LogoutRequest … IssueInstant=”2015-09-28T16:27:36Z”…>

Table 17. Timestamp, logout.

Session identifier

Description

The code that identifies the SSO session created by the Identification service was given and that the e-service received as an identification response.

In addition to the code, the collect2: NameID element must contain the unchanged attributes (NameQualifier, SPNameQualifier, and Format) obtained in the identification response.

Placement

saml2:NameID-element.

Format

Character string

Mandatory

Yes

Example

<saml2p:LogoutRequest …
<saml2:NameID
xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
NameQualifier="https://testi.apro.tunnistus.fi/idp1"
SPNameQualifier="https://kalastus.kunta.fi/lupa-asiat">
AAd ... dsUA==
</saml2:NameID>

Table 18. Session identifier.

Session index

Description

One-time login index information provided for the e-service in the identification response.

Placement

<samlp:LogoutRequest>

Format

String

Mandatory

Yes

Example

<saml2p:LogoutRequest …
<saml2p:SessionIndex>_2c41c54f41a76ec6aaeede9a9bc46a24</saml2p:SessionIndex>…

Table 19. Session index information.


Event code

Description

The event code set by the e-service that enables the preservation of the e-service's status information throughout the logout event.

Can be used, for example, so that the e-service can, based on the task, direct the end-user to the defined page after the log-out.

The event code is not included in the SAML message but is communicated using the HTTP protocol.

Placement

RelayState-parameter

Format

Max 80 characters

Mandatory

No

Example

<form method="post" action=”….
<input type="hidden" name="RelayState" value="token" />

Table 20. Event code, logout.

Logout response

The e-service can send a log-out response to the Identification service or vice versa (see Figure 3). The logout response has the same structure in both cases.

If the one-time login session is missing, for example, because the identification was done with eIDAS identification or the session has become obsolete, LogoutREsponse is returned as a logon response with StatusCode "Requester" and StatusMessage "An error occurred".

Supported bindings are HTTP POST and HTTP REDIRECT.

Please note that the logout response is sent to the service that initiates the logout (In case several e-Services are logged out) only after the user clicks the "BACK TO THE E-SERVICE" link.

Timestamp

Description

Time when the logout response was created.

Placement

saml2p:LogoutResponse-element's IssueInstant-attribute.

Format

Character string, 20 characters.

W3C XML Schema definition data type DateTime which has the format "YYYY-MM-DDThh: mm: ss".

In UTC format, without time zone.

Mandatory

Yes

Example

<saml2p:LogoutResponse … IssueInstant=”2015-09-28T16:27:36Z” …

Table 21. Timestamp, the logout response.

e-Service identity

Description

E-service code. Refers to the EntityID attribute defined in the e-service metadata.

Placement

saml2p:LogoutResponse-element's saml2:issuer-element.

Format

Character string, length max 1024 characters.

URL format.

Mandatory

Yes

Example

<saml2p:LogoutResponse …
<saml2:Issuer>https://kalastus.kunta.fi/lupa-asiat </saml2:Issuer>

Table 22. e-service code, the logout response.

Relay State

Description

The event code set by the e-service that enables the preservation of the e-service's status information throughout the logout event.

Can be used, for example, so that the e-service can, based on the task, direct the end-user to the defined page after the log-out.

The event code is not included in the SAML message but is passed as a parameter to the HTTP command.

Placement

RelayState-parameter.

Format

Max 80 characters

Mandatory

No

Example

<form method="post" action=”….
<input type="hidden" name="RelayState" value="token" />

Table 23. Event code, logout response.

Response status

Description

Information about how the log-out event succeeded

Placement

saml2p:LogoutResponse-element's saml2p:Status-element.

Format

Character string.

Higher level status codes:

  • Success = Logout succeeded
  • Requester = The processing of the logout request failed
  • VersionMismatch = Wrong version in logout request

Mandatory

Yes

Example

<saml2p:LogoutResponse …
<saml2p:Status>
<saml2p:StatusCode
Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</saml2p:Status>

Table 24. Return status, response to logout request.

Finnish Authenticator

To use Finnish Authenticator in Suomi.fi e-Identification requires a separate contract.

NOTE! Finnish Authenticator is NOT A STRONG IDENTIFYING METHOD.

The following information is communicated about foreign persons identified with the identifier:

First name

http://eidas.europa.eu/attributes/naturalperson/CurrentGivenName

Family name

urn:oid:2.5.4.4

The foreign person's identification code

urn:oid:1.2.246.517.3002.111.17

Birth date

http://eidas.europa.eu/attributes/naturalperson/DateOfBirth

Table 25. Information communicated about foreign persons identified with the identifier.

Finnish Authenticator can be used with the identification tool urn: oid: 1.2.246.517.3002.110.7

Finnish Authenticator can be found (once added to the metadata) behind "Other european identification" -selection.


Updated: 7/10/2026

Are you satisfied with the content on this page?