Step by step
- Your app redirects the user to the Dorvis authorization endpoint with
client_id,redirect_uri,scope,stateandnonce. - Without
acr_valuesDorvis shows the method selection. With it, the user goes straight to the Smart-ID, eParaksts or bank page. - After a successful login Dorvis redirects the user back to
redirect_uriwithcodeandstate. - Your server checks
stateand sends the code to the token endpoint with the client credentials. - The response contains an
id_tokenand anaccess_token. The ID token includes the first name, last name, personal code and method used. - Your server verifies the ID token signature,
iss,aud,expandnonce, and creates its own session.
Authorization request
https://dorvis.eu/oidc/oauth2/auth
?response_type=code
&client_id=your-client-id
&redirect_uri=https%3A%2F%2Fexample.lv%2Fcallback
&scope=openid%20profile
&state=4f1c8a…
&nonce=9b27e0…
&code_challenge=E9Melhoa…
&code_challenge_method=S256
&acr_values=idp%3Asmartid| Parameter | Required | Meaning |
|---|---|---|
response_type | yes | Always code |
client_id | yes | Integration ID from the portal |
redirect_uri | yes | Must match the registered URI character for character |
scope | yes | openid profile to receive first name, last name and personal code |
state | recommended | Random value for CSRF protection, checked on return |
nonce | recommended | Random value that comes back in the ID token |
code_challenge | recommended | PKCE challenge with method S256 |
acr_values | no | One method, for example idp:smartid |
Callback
https://example.lv/callback?code=ory_ac_…&scope=openid%20profile&state=4f1c8a…The code is valid for a short time and can be used once, so exchange it on the server straight away.
Code exchange
By default an integration uses client_secret_basic, where the credentials go in the HTTP Basic header. If your library sends them in the request body, choose client_secret_post in the integration advanced settings.
curl -X POST https://dorvis.eu/oidc/oauth2/token \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-d grant_type=authorization_code \
-d code="$CODE" \
-d redirect_uri=https://example.lv/callback \
-d code_verifier="$CODE_VERIFIER"curl -X POST https://dorvis.eu/oidc/oauth2/token \
-d grant_type=authorization_code \
-d client_id="$CLIENT_ID" \
-d client_secret="$CLIENT_SECRET" \
-d code="$CODE" \
-d redirect_uri=https://example.lv/callbackResponse
{
"access_token": "ory_at_…",
"token_type": "bearer",
"expires_in": 3599,
"scope": "openid profile",
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6…"
}Did not find the answer?
Write to us and a developer will reply.






