feat: support of automatic oidc endpoint discovery#308
Draft
ThisIsDemetrio wants to merge 5 commits into
Draft
Conversation
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.
What this PR is for?
This PR adds automatic OIDC endpoint discovery to the browser login flow, using the OAuth2 Protected Resource Metadata standard (RFC 9728).
When a user triggers an interactive login,
miactlnow first probes/.well-known/oauth-protected-resource/apion the configured endpoint. If the document is available, it extracts the authorization server URL and performs OIDC Discovery (RFC 8414) viago-oidc/v3to obtain the authorization and token endpoints automatically. The full authorization code + PKCE flow is then executed against those discovered endpoints.If the resource metadata endpoint is absent or returns an error — as is the case for current Mia-Platform Console instances — the flow transparently falls back to the existing Mia-Platform-specific browser login, so there is no behaviour change for existing deployments.
Additionally, the login flow now prints a status message to stderr informing the user that the browser has been opened and confirming when login is successful.