Skip to content

Conversation

@ygpark80
Copy link

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 #304 fixes the same issue for the implicit flow (response_type="token"). This PR addresses the authorization code flow.

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.

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

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."
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