Verified: Drupal 10 +
openid_connect 3.0.0-alpha8 + openid_client_advanced 1.0.0-rc8.
Working: sign-in, user creation, id_token signature checked against JWKS,
nonce, and PKCE S256.1. Modules
openid_connect 3.0.0 is an alpha, which is worth factoring into your planning.
openid_client_advanced pulls in firebase/php-jwt.
2. The client and the three switches
Configuration → People → OpenID Connect, the advanced plugin. Fill inissuer_url, the three
endpoints (/connect/authorize, /connect/token, /connect/userinfo) and scopes.
Turn on all three: use_pkce, use_nonce, and validate_signature with
allowed_algorithms: [RS256]. The keys go in as JWKS JSON — the field expects the contents of
the /.well-known/jwks document, not a link to it.
Three more settings whose absence produces surprising behavior:
openid_connect.settings.user_login_display = above— otherwise the sign-in buttons are simply not visible on the form;override_registration_settingsanduser.settings.register— they decide whether accounts may be created through the provider.
redirect_uri is {site address}/openid-connect/{client entity id}.
3. Drupal requires an email — on every sign-in
The most important part of this recipe.openid_connect rejects the sign-in when the provider
returns no address: the log shows No email address provided by <provider>, and there is no
setting to bypass it.
The direct way is to make email required in Veriqa: set RequireEmail in
Veriqa:ScopesClaims or in the
client entry, and request the email scope. Veriqa then asks
for the address and confirms it by email inside the same sign-in, before it issues the tokens, on
any channel — see Getting the phone number and email. Drupal receives
a real address, and the site needs no changes.
If you do not want to ask users for an email, the fallback is a hook the module documents itself
(openid_connect.api.php) and invokes before that check, so the fix lives in your own module
while the contrib module and Veriqa stay untouched:
mymodule.module
telegram-123456789@telegram.veriqa.invalid. The .invalid domain is
reserved by RFC 2606 and is guaranteed never to be
delivered to — a deliberate trade-off rather than a free workaround:
an account with such an address gets no password resets and no notifications. Use it only
when the site never needs to email the user.
connect_existing_users — the setting you cannot ignore
For a new user Drupal compares the address against existing accounts. With
connect_existing_users enabled it will link the account it finds to the identity from
Veriqa.
With synthetic addresses that is safe: they are deterministic and unique per channel and id. But
as soon as Veriqa starts returning a real address (a required email, the Email channel, or a
resolver of your own), signing in through Veriqa takes over the local account with that address —
the classic account takeover through an unverified email. Enabling this setting makes sense only
when the IdP’s address verification is something you can rely on. An address Veriqa collects is
confirmed unless ClaimCompletionEmailMethods allows Unverified, which gives
email_verified: false.
What you get
The account is created with the name frompreferred_username (alice), and authmap gains a
row provider=openid_connect.veriqa, authname=telegram:123456789 — Drupal links the identity
by the Veriqa sub.
The practical consequence: for Drupal, sub is the account key. If the way it is composed on the
Veriqa side ever changes, previously created users stop being recognized.
Limitations
- The hook above is an example, not a production-ready module: the decision about addresses belongs to the site.