What you need before you start
- An Auth0 tenant on a plan that includes enterprise connections, and a Dashboard user who can manage connections.
- A Dorvis account and an integration in the self-service portal. The Dorvis team creates the account; test credentials are issued by hand without a contract. The Free plan covers Digimaks; Smart-ID, eParaksts and bank login need a paid plan.
- For production Smart-ID, a contract with SK ID Solutions; for bank login, the bank agreements. Test credentials let you build and check the whole connection, but Smart-ID works for real customers only once the company has its own contract. Our Launch Kit handles these applications for you.
- For the claim mapping and
acr_valuessteps: a Management API token with theread:connectionsandupdate:connectionsscopes.
Create the OpenID Connect connection
Register the Auth0 callback in Dorvis
In the Dorvis portal add the redirect URI
https://YOUR_AUTH0_DOMAIN/login/callback(orhttps://YOUR_CUSTOM_DOMAIN/login/callbackif you use a custom domain). Copy the client ID and client secret.Start a new connection
In the Auth0 Dashboard open Authentication → Enterprise, find OpenID Connect and select Create. Give it a Connection name such as
dorvis; it cannot be changed later.Point it at Dorvis
Enter
https://dorvis.eu/oidc/.well-known/openid-configurationas OpenID Connect Discovery URL and the Dorvis Client ID.Use the back channel
Set Communication Channel to Back Channel and enter the Client Secret. Auth0 then uses the authorization code flow and exchanges the code between servers, as Dorvis requires. Front Channel (
response_type=id_token) is not suitable.Set scopes and profile sync
On the Settings tab set Scopes to
openid profileand keep Sync user profile attributes at each login on, so name changes reach Auth0.Enable it for your applications
Enable the connection for the applications that should offer it, and on Login Experience switch on Display connection button with a name such as "Smart-ID, eParaksts or bank".
Connection settings for Dorvis
| Auth0 setting | Value | Note |
|---|---|---|
| OpenID Connect Discovery URL | https://dorvis.eu/oidc/.well-known/openid-configuration | Auth0 reads endpoints and keys from it |
| Communication Channel | Back Channel | Authorization code flow with client secret |
| Callback URL (registered in Dorvis) | https://YOUR_AUTH0_DOMAIN/login/callback | Shown on the connection page |
| Scopes | openid profile | Auth0 reads claims from the ID token, not from /userinfo |
| Sync user profile attributes at each login | On | Keeps given_name and family_name current |
options.attribute_map | use_map with the template below | Copies person_code into the Auth0 profile |
options.upstream_params | acr_values (optional) | Opens one method directly |
Map the Dorvis claims and choose the method
Both settings live in the connection options. The claim mapping can also be edited in the User Mapping field on the connection's Settings tab; upstream_params needs the Management API. A PATCH replaces the whole options object, so first retrieve the connection with GET, edit its options and send back the complete object.
// PATCH https://YOUR_AUTH0_DOMAIN/api/v2/connections/CONNECTION_ID
{
"options": {
"...": "all existing options from GET",
"attribute_map": {
"mapping_mode": "use_map",
"attributes": {
"given_name": "${context.tokenset.given_name}",
"family_name": "${context.tokenset.family_name}",
"name": "${context.tokenset.name}",
"person_code": "${context.tokenset.person_code}"
}
},
"upstream_params": {
"acr_values": { "value": "Smartid" }
}
}
}Separate buttons for Smart-ID, eParaksts and banks
A static upstream_params value applies to every login through that connection. For separate buttons, create one connection per method (for example dorvis-smartid with idp:smartid, dorvis-eparaksts with eParaksts-mobile,eParaksts) and register the same Auth0 callback for each in Dorvis.
Applications can skip the Auth0 login page by adding connection=dorvis-smartid to their /authorize request. Auth0 lists acr_values among the parameters allowed as an alias, but notes that not every identity provider supports upstream parameters, so test the dynamic variant with your tenant.
Values: idp:smartid, idp:eparaksts-mobile, idp:eparaksts, idp:swedbank, idp:seb, idp:citadele, idp:luminor or idp:edim (Digimaks). Dorvis reads one value per request.
Post-login Action: pass person_code to one application
Mapped attributes are not added to Auth0 tokens automatically. Add a custom claim only for the application that needs the personal code.
exports.onExecutePostLogin = async (event, api) => {
if (event.connection.strategy !== 'oidc') return;
if (event.client.client_id !== event.secrets.APP_CLIENT_ID) return;
const personCode = event.user.person_code;
if (personCode) {
api.idToken.setCustomClaim('https://your-app.example.lv/person_code', personCode);
}
};Did not find the answer?
Write to us and a developer will reply.






