Discuss a project
menu

Adding EU Digital Identity Wallet login to an application that already has one

eudiw-adapter 0.4.0 can act as an OpenID Connect provider, so Nextcloud, Keycloak or any identity provider adds EU Digital Identity Wallet login from its settings. How it works, how accounts are linked, what is tested and what is not.

Most applications that could accept the EU Digital Identity Wallet already have a login. Nextcloud has its users, a company portal sits behind Keycloak or Microsoft Entra ID, a shop uses Auth0. Adding the wallet as one more way to sign in should not mean rebuilding that login around OpenID4VP, trust lists and credential formats.

Every one of those systems already knows how to add an external login: they accept OpenID Connect providers, the same mechanism behind "sign in with Google". So eudiw-adapter, our open-source EUDI Wallet verifier, can now act as one. Version 0.4.0 lets an application or identity provider add "EU Digital Identity Wallet" with three values: an issuer URL, a client id and a secret.

why a provider and not a plugin

Our first design was a Keycloak extension that called the adapter's verification API. It would have worked for Keycloak and for nothing else. Auth0, Okta and Entra ID do not load plugins, and Ory, Authentik and Zitadel each have their own extension model.

What they all support is an upstream OpenID Connect provider. Making the adapter that provider covers all of them with one implementation, and the verification stays in one place: the same trust lists, status checks, relying-party registration and request-signing keys that the adapter already uses for age checks and other verifications.

what an integration looks like

On the adapter, the tenant gets an ID token key and a key for deriving subject identifiers, and each application becomes a client with a login policy:

"oidc_provider": {
  "signing_key_file": "/keys/oidc-id-token-key.pem",
  "subject_key_file": "/keys/oidc-subject-key"
},
"clients": [{
  "client_id": "nextcloud",
  "policies": ["pid-login"],
  "oidc": {
    "client_secret_file": "/keys/oidc-nextcloud-secret",
    "redirect_uris": ["https://cloud.example/index.php/apps/user_oidc/code"],
    "policy_id": "pid-login",
    "subject_claims": ["issuing_country", "personal_administrative_number"],
    "id_token_claims": { "given_name": "given_name", "family_name": "family_name" }
  }
}]

On the application side, nothing is installed beyond what the product already ships. In Nextcloud, the stock user_oidc app takes the provider in one command:

occ user_oidc:provider eudi-wallet --clientid=nextcloud --clientsecret="$SECRET" \
  --discoveryuri=https://adapter.example/oidc/my-tenant/.well-known/openid-configuration

In Keycloak, it is an identity provider of type OpenID Connect with the same discovery URL. The login page then shows "EU Digital Identity Wallet" next to the existing options.

what the user sees

The application sends the user to the adapter's login page. It shows a QR code to scan with the wallet, and a button to open the wallet when the user is already on their phone. The wallet shows who is asking and what for, the user approves, and the page continues by itself: the user lands back in the application, signed in.

Under the page, the adapter runs a normal verification: a signed OpenID4VP 1.0 request under the HAIP 1.0 profile, an encrypted response, the issuer's certificate chain against a trusted list, and the credential's revocation status. Only then does it issue an authorization code, and only to the browser that started the login.

The provider is deliberately small. It supports the authorization code flow with PKCE and nothing else: no refresh tokens, no provider session, no logout. Every login is a fresh wallet presentation.

the hard part is the account, not the protocol

A wallet presentation proves facts about a person. A login needs something else: the same identifier every time, so the application finds the same account.

The PID, the person identification data in the wallet, does not guarantee one. Its personal_administrative_number is optional and each member state decides whether to include it. Wallets also present credentials that are issued in batches with a different key each, so that presentations cannot be linked, which rules out the wallet's key as an identifier.

So the adapter derives the subject from claims you choose, for example the issuing country and the personal administrative number, with a keyed hash per application. The same person gets the same subject on every login, also after their credential is reissued, and two applications cannot correlate a user by comparing subjects. If a presentation lacks one of the chosen claims, the login fails instead of guessing.

When no persistent identifier is available, you can build the subject from names and birth date, but the configuration makes you say so explicitly, because two people with the same values would then share an account and a name change would create a new one.

Linking the wallet to an existing account stays where it already happens: in the identity provider. Keycloak's first-login flow, for example, attaches the wallet identity to an account, and the user signs in once the usual way to link an existing one. The adapter never sends an email address or username, because identity providers link accounts on those claims, and a claim the provider cannot verify should never decide which account someone enters.

how it is tested

Every change to the adapter runs both integrations in CI with a synthetic PID from the independent eudi-dev test wallet:

  • Keycloak 26.8 as an identity broker: a headless browser signs in to Keycloak's account console twice. The first login creates an account through Keycloak's first-login flow; the second lands on the same account without asking anything.
  • Nextcloud 35 with its stock user_oidc app: two logins, one Nextcloud user.

Inside the service, tests cover a replayed authorization code (it fails and revokes the token it produced), PKCE, redirect URIs, client authentication, another browser trying to complete someone's login, parallel completions producing one code, and that names and identifiers never reach logs or the database in plain text. The integration guide lists, product by product, what has been run and what has not.

what 0.4.0 does not cover

  • Ory, Authentik, Zitadel, Auth0, Okta and Entra ID are documented but not tested. Some SaaS identity providers expect an email claim from every external login, which a wallet login never sends. Check yours first.
  • QR relay. Someone who starts a login can show its QR code to another person and receive their identity if that person presents. The wallet shows the relying party's registered name. The Digital Credentials API's cross-device flow, which checks that the phone is near the computer, is the fix; it comes to the login page once we have tested it with a phone wallet.
  • Existing Nextcloud accounts. Connected directly, Nextcloud creates a new account on the first wallet login. To link existing users, put an identity provider in front.
  • Issuer scope. The subject is not tied to the credential's issuer, so a login policy should trust only PID providers.
  • No certification. The OpenID Foundation's provider tests have not been run, and there has been no external security review.

The design and its limits are recorded in ADR-018.

from a login button to a rollout

Turning on the button is the easy part now. Deciding which credentials identify a person in your service, how existing accounts get linked, and what your registration as a relying party has to say is the work that remains. We help teams connect EUDI wallets to the products and identity systems they already run. See our identity project work, or tell us what you are building.

Working on something similar? Talk to us

← all writing