eID Easy authentication page flow

For a complete authentication of a user, you need to follow these steps:

1. Redirect the user to eID Easy authorize endpoint.

URL: https://id.eideasy.com/oauth/authorize

Required query parameters:

ParameterDescription
client_idclient_id value that you got when registering the website
redirect_uriYou set this value when you registered your website in My Webpagesopen in new window
response_typeThis is always code.

Optional query parameters:

ParameterDescriptionValues
stateRECOMMENDED: A unique string to prevent CSRF attacks.Any string.
langLanguage of the user. Use 2-letter codes.ISO 639-1open in new window
startUser’s selected method code. Authentication begins with this method if specified.See available method codes.
phoneSupported methods (e.g Mobile-ID) mobile number prefill.Mobile number.
idcodeSupported methods (e.g Smart-ID and Mobile-ID) number prefill.ID code.
countryCountry preselect.EE, LT, LV, etc.
lang_selectorDetermines whether the language selector is shown or not.true | false.
cancel_buttonDetermines whether the cancel button is shown or not.true | false.
allow_method_changeIf set to false, the user can only use the method provided with the start and country params.true | false.
scopeA + separated list of scopes.

Example: https://id.eideasy.com/oauth/authorize?client_id=pM...m5&redirect_uri=https://your-site.com/login&response_type=code

Important Information about Scopes.

  1. Scopes are enabled per method. Please contact us to enable scopes for the supported method(s).
  2. Not all methods support scopes.

‼️

We recommend using additional scopes in a situation where you automatically choose a method for your end user, that is use allow_method_change=false, start, and country query parameters. Your users would experience error if they are able to choose methods for themselves and scopes are not enabled for those methods.

2. User will go through the authentication flow on our login page.

Don’t worry, we’ll send them back.

3. After authentication, user is redirected to your redirect_uri.

e.g https://your-site.com/login?code=j93jd0qk. Notice you received a query param named code. We’ll use this in the next step.

If you have set the state parameter in the step 1, your redirect_uri will also contain the state parameter. e.g https://your-site.com/login?code=j93jd0qk&state=xyz123. Ensure that the state value is the same as the one you set in step 1.

4. Make a POST request eID Easy server to ask for access token.

URL: https://id.eideasy.com/oauth/access_token

Required headers:

Header NameValue
Content-Typeapplication/x-www-form-urlencoded

Required body parameters:

ParameterDescription
client_idclient_id value that you got when registering the website
client_secretsecret value that you got when registering the website
redirect_uriredirect_uri value that you entered when registering the website
codecode value that was set when redirecting user back from authorization endpoint
grant_typeThis is always authorization_code.

Example Request body:

{
  "code": "j93jd0qk",
  "grant_type": "authorization_code",
  "client_id": "pM...m5",
  "client_secret": "Iu...ch",
  "redirect_uri": "http://example.com/login"
}

Example response:

{
  "access_token":"yF...zc",
  "token_type":"Bearer",
  "expires_in":3600
}

You’ll need the access_token value in the next step.

5. Make a GET request to eID Easy server to ask for user details.

URL: https://id.eideasy.com/api/v2/user_data

Add the access_token value to the HTTP Authorization request headeropen in new window.

Example:

Authorization: 'Bearer yF...zc'

Example response:

{
  "status": "OK",
  "idcode": "39111123456",
  "lastname": "John",
  "firstname": "Smith",
  "current_login_method": "ee-id-login",
  "birth_date": "1991-11-11",
  "country": "EE"
}

About returned data

Not all methods return the same data. For example, some methods do not return the idcode or birth_date values. See Electronic Identities in test environment for more details about the returned data of each methods.

Last Updated: