fix: remove non-functional OAuth2.1/DCR flow, keep client-credentials and bearer token auth - #104
Draft
ThisIsDemetrio wants to merge 1 commit into
Draft
fix: remove non-functional OAuth2.1/DCR flow, keep client-credentials and bearer token auth#104ThisIsDemetrio wants to merge 1 commit into
ThisIsDemetrio wants to merge 1 commit into
Conversation
… and bearer token auth
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.
… and bearer token auth
What this PR is for?
After the release of the Mia-Platform Console v15, the OAuth flow cannot be managed by the MCP Server itself, since it won't be able to hit correctly the new authentication layer.
This PR is a proposal to remove the OAuth routes. It is in draft because we want to better analyze the possibilty of connectin with the Keycloak instance of Mia-Platform Console and/or evaluate alternatives.
/authorizeand/tokenhandlers inoauthRouter.tsproxied requests to/api/authorizeand/api/oauth/tokenonCONSOLE_HOST. Those endpoints no longer exist in the current Console architecture: OAuth/OIDC is now handled byauthtool's BFF + Keycloak, and its only route that returns a raw access token (/bff/token) is not publicly exposed by the API Gateway — it's reachable exclusively from Envoy's internal Lua token-exchange filter. There is no supported way for an external service like this one to complete that flow, and no change on this repo's side can fix it.src/server/auth/{oauthRouter,wellKnownRouter,clientCredentialsManager,types}.tsand their tests, along with the now-unusedgetBaseUrlFromRequesthelper (src/server/utils.ts) and the@fastify/formbodydependency (only needed for the removed form-encoded/token//registerendpoints)./mcp's existing behavior is preserved as the two remaining, functional auth paths:MIA_PLATFORM_CLIENT_ID/MIA_PLATFORM_CLIENT_SECRET— unaffected by this change./mcprequires anAuthorizationheader and forwards it as-is to the Console APIs, which validate it. This already existed but wasn't documented; the README/default.envnow describe it explicitly instead of the dead OAuth2.1/DCR flow.WWW-Authenticate: Bearerheader, dropping theresource_metadatapointer to the removed.well-known/oauth-protected-resourceendpoint.