OIDC Interface Testing Guidelines
Before the deployment of OIDC integration in the production environment, at least the following tests must be carried out in the e-service.
Test the flow of basic identification in its entirety:
- Start the identification request from the e-service.
- Use the selected identification token to carry out identification.
- Make sure that the e-service receives the authorization code and the state matches the original request.
- Make sure the token request is successful and returns the id_token.
- Verify that the id_token passes validation (signature, iss, aud, exp, nonce).
- Make sure that the id_token claims match the requested scopes and that personal data is displayed correctly in the e-service.
- Also test error situations, e.g. the user interrupts identification (access_denied). Make sure that the e-service processes the error appropriately.
Also read the following instructions:
Test that single sign-on works as expected between several e-services:
- Log in with e-Identification in the e-service to be tested through the OIDC interface
- Open the Suomi.fi e-Identification test service at https://testipalvelu.apro.tunnistus.fi
- Select “Identification”
- Make sure that the user is not asked for to sign on again, but that the existing single sign-on session is identified and the user is shown the "Data Forwarding" page.
- Test the functionality of the single sign-on session also by starting identification first in the Suomi.fi e-Identification test service
The second e-service can be the Suomi.fi e-Identification OIDC test service https://testipalvelu.apro.tunnistus.fi/oidc/ or
The Suomi.fi e-Identification SAML test service https://testipalvelu.apro.tunnistus.fi/ or another of the e-service’s own services.
Note: The Single Sign-on session is shared between SAML and OIDC integrations during migration transition.
Test the e-service’s own logout (RP-initiated logout).
- Sign in to the e-service to be tested.
- Start logout from the e-service.
- Make sure that the local session of the e-service is deleted before directing the user to Suomi.fi e-Identification’s end-session.
- Ensure that the user is successfully redirected back to post_logout_redirect_uri. Make sure that the user can no longer access the e-service without new identification.
Also read the OIDC - Logout request and response guide.
Test that logging out of one service also ends the session in other services into which you have identified yourself during the same single sign-on session.
- Identify yourself in the e-service to be tested and identify oneself in the Suomi.fi e-Identification test service with the same single sign-on session (see section 2).
- Log out of the Suomi.fi e-Identification test service.
- Make sure that Suomi.fi e-Identification sends a logout request to frontchannel_logout_uri in the hidden iframe element as specified in the e-service metadata, including iss and sid parameters.
- Make sure that the e-service deletes the session based on its sid and returns HTTP code 200.
- Make sure that the user can no longer access the e-service without new identification.
- Also test a situation in which there is no active session for sid in the e-service (e.g. the session has already expired). In this scenario, the service must return the HTTP code 200 instead of an error.
Single Logout (SLO) works consistently between SAML and OIDC interfaces
Single Logout can be initiated either through the SAML or OIDC interface and it is forwarded to all the e-services in the same Single Sign-on session, regardless of the API they use. In other words, Single Logout works in situations where one e-service uses the SAML interface and the other uses the OIDC interface.
Suomi.fi e-Identification changes its signature and encryption keys in the production environment weekly. In the test environment, keys are rotated every weekday.
The e-service must test that the implementation of the e-service processes the rotation of keys without interruption:
- Make sure that the e-service retrieves the keys from the address for the Suomi.fi e-Identification public keys (jwks_uri) dynamically and does not use a fixed-coded key or a kid.
- Make sure that the e-service’s metadata. supports the key type selected by the e-service (RSA or EC). It is not necessary to support all key types at the same time, as Suomi.fi e-Identification only uses the key type that the e-service has specified in its metadata.
- Monitor the flow of the integration in the test environment for at least the time of one key rotation and ensure that identification is possible without interruptions both before and after the key rotation.
- Make sure that the e-service’s own public key address (jwks_uri) is always available because Suomi.fi e-Identification updates it in its cache every 30 minutes or more often if necessary.
- When the e-service rotates its own keys, also test that the identification and token requests are successful during its own key rotation.
Read more: