Authentication in Organisation ID Service
- 1 Initiate Authentication Method
- 1.1.1 JSON Example for initAuthRequest
- 1.1.1.1 organisationId
- 1.1.2 Example Request with ORG_ID userInfoType
- 1.1.3 Example Request with EMAIL userInfoType
- 1.1.4 Example Request with PHONE userInfoType
- 1.1.5 Example Request with SSN userInfoType
- 1.1.6 Example request with UPI userInfoType
- 1.1.7 Example Request with INFERRED userInfoType
- 1.1.8 Possible Errors
- 1.1.9 JSON Response Value
- 1.1.1 JSON Example for initAuthRequest
- 1.2 Get One Authentication Result Method
- 1.2.1 JSON Example for getOneAuthResultRequest
- 1.2.2 Example Request
- 1.2.3 Possible Errors
- 1.2.4 JSON Response Value
- 1.2.4.1 requestedAttributes
- 1.2.4.2 details
- 1.2.5 JSON Response Body with Mock Data for an APPROVED Response
- 1.2.6 JWS Payload with Mock Data for an APPROVED Response
- 1.2.6.1 Final JWS
- 1.3 Get Authentication Results Method
- 1.3.1 JSON Example for getAuthResultsRequest
- 1.3.2 Example Request
- 1.3.3 Possible Errors
- 1.3.4 JSON Response Value
- 1.4 Cancel Authentication Method
- 1.4.1 JSON Example for cancelAuthRequest
- 1.4.2 Example Request
- 1.4.3 Possible Errors
Initiate Authentication Method
This page covers authentication within Freja’s Organisation ID service. For a general guide on the Freja Authentication Service, check this page.
The method is called using HTTP POST through the URLs below:
Environment | Endpoint |
|---|---|
TEST |
|
PRODUCTION |
|
Important!
You need to have an Organisation ID set for a user to be able to initiate authentication requests using these URLs. If that is not the case, please refer to Organisation ID Service.
JSON Example for initAuthRequest
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",
"attributesToReturn":[
{
"attribute":"Type of attribute to be returned"
}
],
"orgIdIssuer":"Optional, should be ANY if requested organisation ID is set by another Relying Party"
} |
In order to be able to request organisation ID set by another Relying Party, you must first get in touch with partnersupport@frejaeid.com. |
organisationId
Below is the organisationId attribute.
"organisationId":
{
"identifier":"User's organisation identifier",
"issuerFriendlyName":{"EN":" Relying Party Friendly Name", "SV":"Relying Party Friendly Name"},
"issuerCode":"Organisational code",
"additionalAttributes":[
{
"key":"attribute_key",
"value":"attribute_value",
"displayText":"attribute_name"
}
]
}Example Request with ORG_ID userInfoType
If you wish to initiate authentication request for a user with the specific organisation identifier 'vejobla' and request their name, surname and SSN, follow these steps:
Create the JSON structure {"userInfoType":"ORG_ID","userInfo":"vejobla", "attributesToReturn":[{"attribute":"BASIC_USER_INFO"},{"attribute":"SSN"}]}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAuthRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (compact format, line broken for clarity only):
initAuthRequest=eyJ1c2VySW5mb1R5cGUiOiJPUkdfSUQiLCJ1c2VySW5mbyI6InZlam9ibGEiLC
AiYXR0cmlidXRlc1RvUmV0dXJuIjpbeyJhdHRyaWJ1dGUiOiJCQVNJQ19VU0VSX0lORk8ifSx7ImF0
dHJpYnV0ZSI6IlNTTiJ9XX0=Example Request with EMAIL userInfoType
If you wish to initiate authentication request for a user with an email address joe.black@freja.com and request their name, surname, SSN and organisation identifier, follow these steps:
Create the JSON structure {"userInfoType":"EMAIL","userInfo":"joe.black@freja.com","attributesToReturn":[{"attribute":"BASIC_USER_INFO"},{"attribute":"SSN"},{"attribute":"ORGANISATION_ID_IDENTIFIER"}]}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAuthRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (compact format, line broken for clarity only):
initAuthRequest=eyJ1c2VySW5mb1R5cGUiOiJFTUFJTCIsInVzZXJJbmZvIjoiam9lLmJsYWNrQHZ
lcmlzZWMuY29tIiwiYXR0cmlidXRlc1RvUmV0dXJuIjpbeyJhdHRyaWJ1dGUiOiJCQVNJQ19VU0VSX0
lORk8ifSx7ImF0dHJpYnV0ZSI6IlNTTiJ9LHsiYXR0cmlidXRlIjoiT1JHQU5JU0FUSU9OX0lEX0lER
U5USUZJRVIifV19Example Request with PHONE userInfoType
If you wish to initiate authentication request for a user with a phone number '+46731234567':
Create the JSON structure {"userInfoType":"PHONE","userInfo":"+46731234567"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAuthRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following:
initAuthRequest=eyJ1c2VySW5mb1R5cGUiOiJQSE9ORSIsInVzZXJJbmZvIjoiKzQ2NzMxMjM0NTY3In0=Example Request with SSN userInfoType
If you wish to initiate authentication request for a user with an SSN '198905218072' and country 'SE':
Create the JSON structure {"country":"SE","ssn":"198905218072"}, then do the base64 of this JSON.
This is the Base64 of step 1, 'eyJjb3VudHJ5IjoiU0UiLCJzc24iOiIxOTg5MDUyMTgwNzIifQ==', which is the userInfo value in our request.
Create the JSON structure {"userInfoType":"SSN","userInfo":"eyJjb3VudHJ5IjoiU0UiLCJzc24iOiIxOTg5MDUyMTgwNzIifQ=="}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAuthRequest and the Base64 encoded JSON structure from the step 4 as its value.
The HTTP body should be the following:
initAuthRequest=eyJ1c2VySW5mb1R5cGUiOiJTU04iLCJ1c2VySW5mbyI6ImV5SmpiM1Z1ZEhKNUlq
b2lVMFVpTENKemMyNGlPaUl4T1RnNU1EVXlNVGd3TnpJaWZRPT0ifQ==Example request with UPI userInfoType
If you wish to initiate authentication request for a user with unique personal identifier 5633-823597-7862 and request their name, surname, SSN and organisation identifier, follow these steps:
Create the JSON structure {"userInfoType":"UPI","userInfo":"5633-823597-7862","attributesToReturn":[{"attribute":"BASIC_USER_INFO"},{"attribute":"SSN"},{"attribute":"ORGANISATION_ID_IDENTIFIER"}]}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAuthRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (compact format, line broken for clarity only):
initAuthRequest=eyJ1c2VySW5mb1R5cGUiOiJVUEkiLCJ1c2VySW5mbyI6IjU2MzMtODIzNTk3
LTc4NjIiLCJhdHRyaWJ1dGVzVG9SZXR1cm4iOlt7ImF0dHJpYnV0ZSI6IkJBU0lDX1VTRVJfSU5G
TyJ9LHsiYXR0cmlidXRlIjoiU1NOIn0seyJhdHRyaWJ1dGUiOiJPUkdBTklTQVRJT05fSURfSURF
TlRJRklFUiJ9XX0=Example Request with INFERRED userInfoType
If you wish to authenticate a user via a QR code:
Create the JSON structure {"userInfoType":"INFERRED","userInfo":"N/A"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAuthRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following:
initAuthRequest=eyJ1c2VySW5mb1R5cGUiOiJJTkZFUlJFRCIsInVzZXJJbmZvIjoiTi9BIn0=Possible Errors
Code Returned | Explanation |
|---|---|
0 | Internal error. |
1001 | Invalid or missing userInfoType. |
1002 | Invalid or missing userInfo. |
1004 | You are not allowed to call this method. |
1005 | User has disabled your service. |
1008 | Unknown Relying Party. |
1009 | You are not allowed to request integratorSpecificUserId parameter. |
1010 | JSON request cannot be parsed. |
1012 | User with the specified userInfo does not exist in Freja eID database. |
2000 | Authentication request failed. Previous authentication request was rejected due to security reasons. |
2002 | Invalid attributesToReturn parameter. |
2003 | Custom identifier has to exist when it is requested. |
4001 | In order to use organisational transactions, user must have an Organisation ID set. |
4007 | Invalid organisation id issuer. |
JSON Response Value
If HTTP 200 is returned from the method, the following return value will be present in the body of the response:
{
"authRef":"Reference to be submitted in getAuthResults method"
} |
|
Get One Authentication Result Method
The method is called using HTTP POST through the URLs below:
Environment | Endpoint |
|---|---|
TEST |
|
PRODUCTION |
|
JSON Example for getOneAuthResultRequest
The parameter of the method is a Base64 UTF8-encoded JSON payload according to the following:
{
"authRef":"Authentication reference"
} | authRef: string, mandatory. The value must be equal to an authentication reference previously returned from a call to the Initiate Authentication Method. Because authentications are short-lived, fetching the result of a given authRef is only possible within 10 minutes from the time the initial authentication request was made. |
Example Request
If you wish to fetch an authentication result with the authentication reference previously returned from a call to initAuthRequest (for a user with specific organisation identifier 'vejobla'), follow these steps:
Create the JSON structure {"authRef":"GOHPyJcoKLJ+zKCEy4abi6jOO+q5VK+S1+UO5OXRmOPu42ixvVnsVgs7ADYUfG8m"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name getOneAuthResultRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (compact format, line broken for clarity only):
getOneAuthResultRequest=eyJhdXRoUmVmIjoiR09IUHlKY29LTEorektDRXk0YWJpNmpPTytxNV
ZLK1MxK1VPNU9YUm1PUHU0Mml4dlZuc1ZnczdBRFlVZkc4bSJ9Possible Errors
Code Returned | Explanation |
|---|---|
1004 | You are not allowed to call this method. |
1008 | Unknown Relying Party. |
1100 | Invalid reference (for example, nonexistent or expired). |
JSON Response Value
If HTTP 200 is returned from the method, the following return value will be present in the body of the response:
{
"authRef":"Authentication reference",
"status":"Authentication status",
"requestedAttributes":"Additional attributes about the user",
"details":"JWS signed data"
} |
|
requestedAttributes
Below is an example with requestedAttributes unique to this service. For the full list refer to https://frejaeid.atlassian.net/wiki/spaces/DOC/pages/2162802/Authentication+Service#requestedAttributes.
{
"organisationIdIdentifier":"Specific organisation identifier",
"organisationId":{
"identifier":"User's organisation identifier",
"issuerFriendlyName":{
"EN":" Relying Party Friendly Name",
"SV":"Relying Party Friendly Name"},
"issuerCode":"Organisational code",
"additionalAttributes":[
{
"key":"attribute_key",
"value":"attribute_value",
"displayText":"attribute_name"
}
]
},
} |
|
details
JWS in compact serialised form as following:
BASE64URL(UTF8(JWS Protected Header)) || ’.’ || BASE64URL(JWS Payload) || ’.’ || BASE64URL(JWS Signature)
JWS Protected Header | |
{
"x5t":"SHA-1 digest of the signing certificate",
"alg":"algorithm used to secure the JWS"
} |
|
JWS Payload | |
{
"authRef":"Authentication reference",
"status":"Authentication status",
"userInfoType":"User info type",
"userInfo":"User information corresponding to user info type",
"minRegistrationLevel":"Minimum required registration level of a user",
"requestedAttributes":{
JSON object, see below.
},
"timestamp":"Time when authentication is confirmed by end user"
} |
|
JSON Response Body with Mock Data for an APPROVED Response
{
"authRef":"12345-67890-abcdef",
"status":"APPROVED",
"details":"JWS content as per below",
"requestedAttributes":{
"basicUserInfo":{
"name":"Joe",
"surname":"Black"
},
"emailAddress":"joe.black@freja.com",
"allEmailAddresses":[
{
"emailAddress":"joe.black@freja.com"
},
{
"emailAddress":"joebl@domain.com"
}
],
"allPhoneNumbers":[
{
"phoneNumber":"+4600000000"
},
{
"phoneNumber":"+4611111111"
}
],
"dateOfBirth":"1985-11-17",
"age":"36",
"photo":"iVBORw0KGgoAAAANSUhEUgAAAhwAAANgCAIAAADoCyYlAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACAhSURBVHhe7d2xdSJL3sbhm83mQA5KA1chfI48OciRJ+cGgKkk
CEEJbBb7wWhmEFUNdHW/0EA/5zzOnYWGQmf/P7oaiX/+93//AYAIUQEgRlQAiBEVAGJEBYAYUQEgRlQAiBEVAGJE
BYAYUQEgRlQAiBEVAGJEBYAYUQEgRlQAiBEVAGJEBYAYUQEgRlQAiBEVAGJEBYAYUQEgRlQAiBEVAGJEBYAYUQEg
RlQAiBEVAGJEBYAYUQEgRlQAiBEVAGJEBYAYUQEgRlQAiBEVAGJEBYAYUQEgRlQAiBEVAGJEBYAYUQEgRlQAiBEV
AGJEBYAYUQEgRlQAiBEVAGJEBYAYUQEgRlQAiBEVAGJEBYA...",
"addresses":[
{
"country":"SE",
"city":"Stockholm",
"postCode":"11120",
"address1":"C/O Joe Black",
"address2":"Visdomsgatan 55",
"validFrom":"2020-03-19",
"type":"RESIDENTIAL",
"sourceType":"GOVERNMENT_REGISTRY"
},
{
"country":"NO",
"city":"Oslo",
"postCode":"0001",
"address1":"P.O. Box 456",
"validFrom":"2020-03-19",
"type":"POSTAL",
"sourceType":"GOVERNMENT_REGISTRY"
}
],
"ssn":{
"ssn":"198511170040",
"country":"SE"
},
"document" : {
"type":"PASS",
"country":"SE",
"serialNumber":"XA0000001",
"expirationDate":"2027-01-01"
},
"registrationLevel":"EXTENDED",
"uniquePersonalIdentifier":"5753-979204-7861,
"loaLevel":"LOA3",
"organisationIdIdentifier":"vejobla",
"organisationId":{
"identifier":"vejobla",
"issuerFriendlyName":{
"EN":" Freja eID",
"SV":"FREJA"},
"issuerCode": null,
"additionalAttributes":[
{
"key":"USER_ID",
"value":"123456789",
"displayText":"ID"
}
]
},
"relyingPartyUserId":"94039a98c8d",
"integratorSpecificUserId":"54059a95c8d"
}JWS Payload with Mock Data for an APPROVED Response
Certificate Info: for more information refer to https://frejaeid.atlassian.net/wiki/spaces/DOC/pages/2162826/REST+API+Documentation#%5BinlineExtension%5DCertificates-in-Freja-eID |
Header: BASE64URL(UTF8(JWS Protected Header)) || ’.’ || BASE64URL(JWS Payload) || ’.’ || BASE64URL(JWS Signature) |
{
"authRef":"12345-67890-abcdef",
"status":"APPROVED",
"userInfoType":"EMAIL",
"userInfo":"joe.black@freja.com",
"requestedAttributes":{
"basicUserInfo":{
"name":"Joe",
"surname":"Black"
},
"emailAddress":"joe.black@freja.com",
"..."
},
"timestamp":1584701027510
} |
Final JWS
eyAiYXV0aFJlZiI6IjEyMzQ1LTY3ODkwLWFiY2RlZiIsICJzdGF0dXMiOiJBUFBST1ZFRCIsICJ1c2VySW5mb1R5cGUiOiJFTUF
JTCIsICJ1c2VySW5mbyI6ImpvZS5ibGFja0B2ZXJpc2VjLmNvbSIsICJyZXF1ZXN0ZWRBdHRyaWJ1dGVzIjp7ICJiYXNpY1VzZX
JJbmZvIjp7ICJuYW1lIjoiSm9lIiwgInN1cm5hbWUiOiJCbGFjayIgfSwgImVtYWlsQWRkcmVzcyI6ImpvZS5ibGFja0B2ZXJpc
2VjLmNvbSIsICJhbGxFbWFpbEFkZHJlc3NlcyI6WyB7ICJlbWFpbEFkZHJlc3MiOiJqb2UuYmxhY2tAdmVyaXNlYy5jb20iIH0s
IHsgImVt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HJ1
ZQp9CsKgIMKgfSwgInRpbWVzdGFtcCI6MTU4NDcwMTAyNzUxMCB9Get Authentication Results Method
The method allows a relying party to fetch the results of multiple outstanding authentications. It is our recommendation that you generally use the aggregate method, as it is more efficient and reduces network traffic. This is the default behaviour of the client library supplied by Freja eID.
The method is called using HTTP POST through the URLs below:
Environment | Endpoint |
|---|---|
TEST |
|
PRODUCTION |
|
JSON Example for getAuthResultsRequest
The parameter of the method is a Base64 UTF8-encoded JSON payload according to the following:
{
"includePrevious":"Include previously returned results"
} |
|
Example Request
If you wish to fetch multiple authentication results, follow these steps:
Create the JSON structure {"includePrevious":"ALL"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name getAuthResultsRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following:
|
Possible Errors
Code Returned | Explanation |
|---|---|
1004 | You are not allowed to call this method. |
1008 | Unknown Relying Party. |
1200 | Invalid or missing includePrevious parameter. |
JSON Response Value
If HTTP 200 is returned from the method, the following return value will be present in the body of the response:
{
"authenticationResults":[
{
"authRef":"Authentication reference",
"status":"Authentication status",
"details":"JWS signed data, see below",
"requestedAttributes":"Additional attributes about the user"
}
{
"authRef":"..."
}
]
} |
|
Cancel Authentication Method
This method is used by a relying party to cancel an authentication request. The method is called using HTTP POST through the URLs below:
Environment | Endpoint |
|---|---|
TEST |
|
PRODUCTION |
|
JSON Example for cancelAuthRequest
The parameter of the method is a Base64 UTF8-encoded JSON payload according to the following:
{
"authRef":"Authentication reference"
} |
|
Example Request
If you wish to cancel an authentication request, follow these steps:
Create the JSON structure {"authRef":"GOHPyJcoKLJ+zKCEy4abi6jOO+q5VK+S1+UO5OXRmOPu42ixvVnsVgs7ADYUfG8m"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name cancelAuth and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following:
|
Possible Errors
Code Returned | Explanation |
|---|---|
1004 | You are not allowed to call this method. |
1008 | Unknown Relying Party. |
1100 | Invalid reference (for example, nonexistent or expired). |
If HTTP 200 is returned from the method, the request was successfully fulfilled.