The handler fits in about 250 lines of PHP, with no Composer and no external dependencies;
verified on the Telegram channel.
Why this is not a sign-in setting
So there is no plugin and no CMS recipe here: what you need is a small server-side handler placed next to the form.Why the handler must be server-side
A browser-only script cannot do it, and it runs into three walls at once:- only the Authorization Code Flow (plus refresh) is supported — there is no implicit and no hybrid;
- no endpoint has CORS configured;
- the access token is an opaque identifier, and introspecting it takes a confidential client with a secret, which a browser script cannot keep.
The flow
- the user clicks the button under the form;
- a redirect to
/connect/authorizewith PKCE S256,stateandnonce— plusacr_valuesif you want a specific channel; - the return to
redirect_uri, an ordinary page of your site; - the server exchanges the code for tokens and validates
iss,aud,expandnonce; - the submission gets a record: “confirmed:
sub+channel_type”; - no authentication cookie is set — nobody signs in.
About signature validation
Validating theid_token signature with a JWT library is not required here: OIDC Core
§3.1.3.7, rule 6 lets a client that obtained the token directly from the token endpoint rely
on TLS verification instead of checking the signature. That is why the handler needs no JWT library
and no Composer.
Your own buttons on your own page
The two buttons under the form — “via Telegram” and “any channel” — are a parameter of the authorize request:acr_values=channel:telegram narrows the choice to one channel, and without
the parameter the user picks.
There is no widget or JS SDK for this, and none is needed: “your own button” is a link with the
right parameters, not an embeddable component.