Skip to content

feat: support of automatic oidc endpoint discovery#308

Draft
ThisIsDemetrio wants to merge 5 commits into
mainfrom
feat/login-with-protected-resource-metadata
Draft

feat: support of automatic oidc endpoint discovery#308
ThisIsDemetrio wants to merge 5 commits into
mainfrom
feat/login-with-protected-resource-metadata

Conversation

@ThisIsDemetrio

@ThisIsDemetrio ThisIsDemetrio commented May 13, 2026

Copy link
Copy Markdown
Contributor

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, miactl now first probes /.well-known/oauth-protected-resource/api on the configured endpoint. If the document is available, it extracts the authorization server URL and performs OIDC Discovery (RFC 8414) via go-oidc/v3 to 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant