The base implementation of OIDC should be secure enough in most cases. This page mentions a few measures that can be taken to increase security, if desired.
In an OIDC flow, you will receive an access token that is signed by Signicat, which you have to use to fetch the user info response. The following table shows how Signicat supports message encryption and signing with OIDC.
|ID token||Signed according to specification.||Optional, off by default.||Example payload:
|User info response||Optional, off by default.||Optional, off by default.||Contains all claims available from the scopes that the user has given consent to. Depends on the ID method.|
Encryption algorithm: AES-128
Supported key length: 2048-bit (4096-bit too, if required)
Signature hash: SHA-256
Encryption of the request object
One of the options for increased security is Full Message-Level Encryption (MLE). This section explains the steps that must be followed to establish MLE with OIDC.
Before the implementation, you must provide Signicat with an encryption key, so that we can encrypt our responses with it. This key needs to be in a specific format. Follow these steps:
Generate a JWK RSA pair (2048-bit). Signicat also supports 4096-bit if required. It is important that you create a JWK and not a PEM, CER, CRT, etc.
Send the public part to Signicat. The public part can be sent through email, as it does not contain sensitive information.
when we store your key in our system, a new Key ID (“kid”) will be generated. We will provide you with this new Key ID. You have to use this Key ID, as we do not have the ability to change the Key ID in our keystore.
You should send your requests as a normal OIDC request (see exception below). The difference between a normal OIDC flow and MLE flow are:
The ID token and the response from user info is a nested JWT which is encrypted and signed.
Decrypt it with your private key from the RSA pair given to Signicat.
Deserialize the resulting signed JWT and verify the signature.
The ID token must, as always, be verified according OIDC specifications.
<ENV> equals preprod.signicat.com for pre-production and your Signicat subdomain for production.
A functional example implementation of full message-level encryption can be found . This example is related to FTN (Finnish Trust Network).
Encrypting Authorization Requests
Normally, authorization requests do not contain any personal data, and as such do not need to be encrypted. There are some unlikely edge-case scenarios where you might include personal data in the authorization request. If your implementation requires it, here’s what you should do:
Begin crafting the OIDC Authorization Request. The parameters are standard OIDC parameters. Examples of Authorization Request encryption in a number of common languages can be found at . The requirements are as follows:
The HTTP request can be made using either GET or POST.
The payload must be a Request Object (per ). An example for a typical payload Request Object looks as follows: [payload example + value descriptions]
The request must be an encrypted JWT; which contains the aforementioned Request Object (as detailed on the ).
The JWE token must be encrypted with the public key (
"use":"enc") available at https://<ENV>.signicat.com/oidc/jwks.json.
The protected header for the JWE token must contain the following claims:
"alg"(the values for “kid” and “alg” are specified at https://<ENV>.signicat.com/oidc/jwks.json).