Dōrvis

Sign in

Auth0 Smart-ID and eParaksts login with Dorvis

To add Auth0 Smart-ID login, together with eParaksts and Latvian bank login, create an OpenID Connect enterprise connection in Auth0 that points to Dorvis. Your applications keep using Auth0 as before; Dorvis handles the Latvian e-identities and returns the verified name and personal code.

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_values steps: a Management API token with the read:connections and update:connections scopes.

Create the OpenID Connect connection

  1. Register the Auth0 callback in Dorvis

    In the Dorvis portal add the redirect URI https://YOUR_AUTH0_DOMAIN/login/callback (or https://YOUR_CUSTOM_DOMAIN/login/callback if you use a custom domain). Copy the client ID and client secret.

  2. 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.

  3. Point it at Dorvis

    Enter https://dorvis.eu/oidc/.well-known/openid-configuration as OpenID Connect Discovery URL and the Dorvis Client ID.

  4. 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.

  5. Set scopes and profile sync

    On the Settings tab set Scopes to openid profile and keep Sync user profile attributes at each login on, so name changes reach Auth0.

  6. 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 settingValueNote
OpenID Connect Discovery URLhttps://dorvis.eu/oidc/.well-known/openid-configurationAuth0 reads endpoints and keys from it
Communication ChannelBack ChannelAuthorization code flow with client secret
Callback URL (registered in Dorvis)https://YOUR_AUTH0_DOMAIN/login/callbackShown on the connection page
Scopesopenid profileAuth0 reads claims from the ID token, not from /userinfo
Sync user profile attributes at each loginOnKeeps given_name and family_name current
options.attribute_mapuse_map with the template belowCopies person_code into the Auth0 profile
options.upstream_paramsacr_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" }
    }
  }
}
Remove upstream_params to let users pick the method in Dorvis. Use { "alias": "acr_values" } instead of "value" to pass the value from the application's /authorize request.

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.

Ask a question
Loading complete

We use cookies to make this website easier to use. Read our Privacy and Cookie Policy.