Custom Identifier Management
Overview of Custom Identifier Management
Freja allows Relying Parties (RP) to manage a single, RP-specific attribute, through the Custom Identifier Management service.
A typical use of this option would be to allow for login identifiers specific to your organisation to be returned within the result of authentication. In other words, the end user can use their preferred identifier at login, e.g. email address. Freja performs the translation to the custom identifier, previously configured by the RP, e.g. employee number or domain login. In such a way, it is straightforward for RPs to map user identifiers to those known within their internal systems, without the need to store this mapping in an internal database or LDAP.
A custom identifier must be unique within the requesting relying party system inside the Freja service. In other words, Freja does not allow two identical custom attributes to be set by the same RP. In order to set a custom identifier for a user, the RP needs to obtain the existing user information for that user in the Freja system (e.g. the email address the user has connected to Freja or the social security number, if the user is on the Freja+ level) and pass it in the call to Freja services.
Set Custom Identifier Method
This method is used by a relying party to set a custom identifier for a specific user. As said before, the existing user information for that user in the Freja eID system must be passed as a parameter of this method.
The method is called using HTTP POST through the URLs below:
Environment | Endpoint |
|---|---|
TEST |
|
PRODUCTION |
|
JSON Example for setCustomIdentifierRequest
The parameter of the method is a Base64 UTF8-encoded JSON payload, according to the following:
{
"userInfoType":"User info type",
"userInfo":"User information corresponding to user info type",
"customIdentifier":"vejodoe"
} |
|
For userInfoType set to PHONE, the value must be in the following format: "+4673*******"; the leading '+' sign is present, but the leading '0' for the mobile phone operator code is not. | |
{
"country":"Country of SSN",
"ssn":"Social security number of the end user"
}Where:
|
EMAIL userInfoType Example Request
If you wish to set a custom identifier for a user with an email address joe.black@freja.com, follow these steps:
Create the JSON structure {"userInfoType":"EMAIL","userInfo":"joe.black@freja.com","customIdentifier":"vejodoe"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name setCustomIdentifier and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (line broken for clarity only):
setCustomIdentifierRequest=eyJ1c2VySW5mb1R5cGUiOiJFTUFJTCIsInVzZXJJbmZvIjoiam9lLmJ
sYWNrQHZlcmlzZWMuY29tIiwgImN1c3RvbUlkZW50aWZpZXIiOiAidmVqb2RvZSJ9PHONE userInfoType Example Request
If you wish to set a custom identifier for a user with a phone number '+46731234567', follow these steps:
Create the JSON structure {"userInfoType":"PHONE","userInfo":"+46731234567","customIdentifier":"vejodoe"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name setCustomIdentifier and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following:
setCustomIdentifierRequest=eyJ1c2VySW5mb1R5cGUiOiJQSE9ORSIsInVzZXJJbmZvIjoiKzQ2NzM
xMjM0NTYiLCAiY3VzdG9tSWRlbnRpZmllciI6ICJ2ZWpvZG9lIn0=UPI userInfoType Example Request
If you wish to set a custom identifier for a user with unique personal identifier '5633-823597-7862', follow these steps:
Create the JSON structure {"userInfoType":"UPI","userInfo":"5633-823597-7862","customIdentifier":"vejodoe"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name setCustomIdentifier and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following:
setCustomIdentifierRequest=eyJ1c2VySW5mb1R5cGUiOiJVUEkiLCJ1c2VySW5mbyI6IjU2MzMtODIzN
Tk3LTc4NjIiLCJjdXN0b21JZGVudGlmaWVyIjoidmVqb2RvZSJ9Possible Errors
Code Returned | Explanation |
|---|---|
1001 | Invalid or missing userInfoType. |
1002 | Invalid or missing userInfo. |
1008 | Unknown relying party. |
1010 | JSON request cannot be parsed. |
5000 | Invalid or missing customIdentifier. |
5002 | You have already used this custom identifier. |
If the request is successfully processed, HTTP 204 is returned from this method.
Delete Custom Identifier Method
This method is used by a relying party to delete a custom identifier for a specific user.
The method is called using HTTP POST through the URLs below:
Environment | Endpoint |
|---|---|
TEST |
|
PRODUCTION |
|
JSON Example for deleteCustomIdentifierRequest
The parameter of the method is a Base64 UTF8-encoded JSON payload, according to the following:
{
"customIdentifier":"vejodoe"
} |
|
EMAIL userInfoType Example Request
If you wish to delete a custom identifier ''vejodoe'', follow these steps:
Create the JSON structure {"customIdentifier":"vejodoe"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name deleteCustomIdentifier and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following:
deleteCustomIdentifierRequest=eyJjdXN0b21JZGVudGlmaWVyIjoidmVqb2RvZSJ9Possible Errors
Code Returned | Explanation |
|---|---|
1008 | Unknown relying party. |
5000 | Invalid or missing customIdentifier. |
5001 | There is no user for given custom identifier. |
If the request is successfully processed, the HTTP 204 is returned from this method.