Make identity-provider sign-in work with the registered client - #220
Closed
rbardaji wants to merge 5 commits into
Closed
Make identity-provider sign-in work with the registered client#220rbardaji wants to merge 5 commits into
rbardaji wants to merge 5 commits into
Conversation
added 2 commits
August 3, 2026 15:22
…e enabled The installer offered sign-in through the identity provider and then asked for a client id with no default and no way of finding one. A blank answer switched it back off, so the feature was offered and could not be taken. Endpoints in the NDP realm do not each need their own client: the platform's public client serves any of them, in the realm the installer already suggests as the issuer. Both are defaults now, so answering yes and pressing Enter is enough, and a client registered for this Endpoint specifically can be given instead. Adds --oidc, --oidc-issuer and --oidc-client-id. These were the only prompts with no flag behind them, which left unattended installs unable to enable sign-in at all.
…in the browser The client an Endpoint gets is confidential: a Federation registration creates one per Endpoint and returns its id and secret. A secret cannot live in a page, so the browser exchange could only ever answer 'Invalid client or Invalid client credentials'. The exchange moves to POST /user/oidc/exchange. The browser starts the flow and brings back the code and its PKCE verifier; the API completes it, sending the client secret from .env, which is never returned by any route and never reaches the UI. A public client uses the same path with no secret configured. The installer follows: the client id prompt can be left blank and the registration's client, with its secret, is what gets written. There is no default client id any more — the platform's own client is confidential and its secret is not ours to have, so offering it would produce a sign-in that starts and cannot finish.
…lient Without a registration there is no client in the provider's realm, so the question could only be answered and then overruled — the installer would ask, record a yes, and print that sign-in stays off anyway. It is now asked only after registering. Otherwise the installer says what sign-in needs and which flags enable it for an operator who already has a client of their own, which the flags still support.
rbardaji
force-pushed
the
feature/219-oidc-default-client
branch
from
August 3, 2026 21:54
f31b659 to
93c1596
Compare
added 2 commits
August 4, 2026 02:33
Asking for the realm URL and the client id was asking the operator to retype what the installer already had: the registration names the realm and creates the client with its secret, and the identity provider's host is the one AUTH_API_URL validates tokens against — they have to be the same provider or sign-in fails at the last step, so the host is a requirement rather than a guess. The realm URL is now derived from those two and checked against its discovery document before anything is written. A realm that does not answer leaves sign-in off and says so, instead of producing a login that starts and cannot finish. The flags still cover a client or realm the registration did not provide.
The stack was started with 'compose up -d', which builds only when no image exists. On a machine that had run an Endpoint before, the container came back from the image built the first time and the checkout was never compiled in: the install reported success while running old code, a route added since answered 404, and the UI served was the one built weeks earlier. Meanwhile .env, rendered on every run, was current — so the mismatch read as a configuration problem. Started with --build now, as the CKAN stack already was. Unchanged sources come from the layer cache.
Collaborator
Author
|
Parking this. Identity-provider sign-in is not going into the installer until how it is meant to work is settled, so the option should not be offered at all in the meantime. What this branch established, for whoever picks it up:
So this needs The one commit here that is independent of all that — the installer reusing a stale image — is now #222. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #219.
The installer offered sign-in through the identity provider, then asked for a client id with no default and no way of finding one:
A blank answer switched sign-in back off with a warning, so the feature was offered and could not be taken.
What changed
Endpoints in the NDP realm do not each need their own client — the platform's public client serves any of them, in the realm the installer already suggests as the issuer. Both are defaults now:
Answering yes and pressing Enter is enough. A client id registered for this Endpoint specifically — a Federation registration creates one and prints it — can be given instead.
--oidc,--oidc-issuerand--oidc-client-idare new. The identity-provider questions were the only prompts with no flag behind them, so an unattended install could not enable sign-in at all, contrary to whatinstall/README.mdclaims.A registration still never switches sign-in on by itself:
--config-idskips every prompt, so there is nobody to ask, and enabling a login method for an operator who did not request it is not the installer's call. It now says how to enable it instead of only saying it is off.Verified
Client id [ndp_frontend_prod]:accepted with Enter,.envgetsOIDC_ENABLED=Truewith both defaults.--oidcalone, and--oidc-client-id <other>, render the expected values; without any of themOIDC_ENABLED=False, unchanged..envserves the UI aconfig.jscarryingoidcEnabled,oidcIssuerandoidcClientId, and the realm's discovery document advertisesS256, which is what the UI's PKCE flow needs.black --check .andflake8clean.While wiring the defaults, an unguarded reference to a variable that does not exist yet at the prompt would have aborted the script under
set -uthe moment anyone answered yes; it is not in the branch.