Identify a User

Log a user in with their eID through the hosted eID Easy login page and receive their verified identity data. This uses standard OAuth 2.0.

β–Ά This quickstart is interactive. Click Send request in each step to call the test environment with the shared sandbox credentials. Values from each response, such as IDs and codes, are filled into the next request automatically.
client_id 2IaeiZXbcKzlP1KvjZH9ghty2IJKM8Lgsecret 56RkLgZREDi1H0HZAvzOSAVlxu1Flx41

1. Try it without code

See what your users will experience:

  1. Open the test demo siteopen in new window and click Try OAuth login in the OAuth 2.0 login card.
  2. Select Estonia, click Smart-ID, and enter the test code 40404049996. It approves automatically.
  3. The demo shows the identity data our API returns.

2. Send the user to the login page

Your app redirects the user to the authorize endpoint. Here, the redirect URI is this page, so you'll come straight back with the result.

https://test.eideasy.com/oauth/authorize?client_id=2IaeiZXbcKzlP1KvjZH9ghty2IJKM8Lg&redirect_uri=YOUR_REDIRECT_URI&response_type=code&state=STATE
You'll come back to this page after logging in.

On the login page, choose Estonia β†’ Smart-ID and enter 40404049996. Need another method? See Test Identities.

3. Receive the authorization code

After logging in, the user is redirected to your redirect URI with a code and the state you sent. Your app should check that state matches.

Waiting for you to log in. Complete the previous step and you'll be redirected back here with a code.

4. Exchange the code for an access token

Your server exchanges the code for an access token. The code is short-lived and can be used only once.

POSThttps://test.eideasy.com/oauth/access_token
curl -X POST https://test.eideasy.com/oauth/access_token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code" \
  -d "code={{code}}" \
  -d "client_id=2IaeiZXbcKzlP1KvjZH9ghty2IJKM8Lg" \
  -d "client_secret=56RkLgZREDi1H0HZAvzOSAVlxu1Flx41" \
  -d "redirect_uri={{redirect_uri}}"
Complete the previous step first. This request needs code.

Call this from your server

This request includes your secret. Here it runs from your browser because the sandbox credentials are public. In your application, always make it server-side.

5. Fetch the user's identity

GEThttps://test.eideasy.com/api/v2/user_data
curl https://test.eideasy.com/api/v2/user_data \
  -H "Authorization: Bearer {{access_token}}"
Complete the previous step first. This request needs access_token.

You get the verified identity of the user who logged in. πŸŽ‰ Returned fields vary by method.

Use your own credentials next

The shared sandbox credentials are for trying things out. Create your own test credentials to set your own redirect URI and enabled methods.

Go live

  • Follow the shared go-live steps.
  • Register your production redirect URI, and configure enabled methods and branding in the live admin panel.
  • Check the method pages for methods that need extra onboarding before production use.

Next steps

You used the hosted login page, the simplest option. Choose how much of the experience you want to own:

Last Updated: