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.
1. Try it without code
See what your users will experience:
- Open the test demo site and click Try OAuth login in the OAuth 2.0 login card.
- Select Estonia, click Smart-ID, and enter the test code
40404049996. It approves automatically. - 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.
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.
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}}"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
curl https://test.eideasy.com/api/v2/user_data \
-H "Authorization: Bearer {{access_token}}"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: