Skip to content

apply pull-318 from upstream#26

Merged
swalker326 merged 3 commits intokagii-dev:masterfrom
shpaw415:fix/token_type-bearer
Apr 1, 2026
Merged

apply pull-318 from upstream#26
swalker326 merged 3 commits intokagii-dev:masterfrom
shpaw415:fix/token_type-bearer

Conversation

@shpaw415
Copy link
Copy Markdown

@shpaw415 shpaw415 commented Mar 25, 2026

Add token_type: 'Bearer' to token endpoint responses for both authorization_code and refresh_token grant types to comply with RFC 6749 Section 5.1.

Changes

  • Add token_type: "Bearer" to authorization_code grant response (line 883)
  • Add token_type: "Bearer" to refresh_token grant response (line 951)
  • Update tests to verify token_type is present in refresh token responses

RFC Compliance

Per RFC 6749 Section 5.1 (https://tools.ietf.org/html/rfc6749#section-5.1):

"The authorization server MUST include the token_type parameter in the response."

This ensures compatibility with OAuth 2.0 clients that require the token_type parameter, such as MCP clients using @mastra/mcp.

Related: PR anomalyco#304 fixes the same issue for the implicit flow (response_type="token"). This PR addresses the authorization code flow.

Original PR: anomalyco#318
This patch was originaly done by @ygpark80

@swalker326 swalker326 merged commit 3ddd738 into kagii-dev:master Apr 1, 2026
2 checks passed
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.

2 participants