vamsii777 / vapor-oauth

OAuth2 Provider Library for Vapor
MIT License
3 stars 2 forks source link

Align JWT scopes Encoding with OAuth 2.0 Specifications in AccessToken and RefreshToken #16

Closed vamsii777 closed 9 months ago

vamsii777 commented 9 months ago

This PR refines the handling of the scopes property within JWT payloads for both AccessToken and RefreshToken structures, transitioning from an array format ([String]?) to a singular string format (String?). This adjustment ensures our JWT scope representation is in full compliance with the OAuth 2.0 Authorization Framework as outlined in RFC 6749.

RFC 6749 specifies that scopes should be space-delimited within the scope parameter. While this standard directly pertains to OAuth 2.0 request parameters, adopting a consistent representation in JWTs promotes uniformity and simplifies integration with OAuth 2.0 compliant systems. Moreover, it enhances interoperability by ensuring scope representations are universally understood and processed in the same manner, irrespective of their context within requests or tokens.

Key Changes:

This change does not affect the OAuth 2.0 request or response formats directly but rather aligns the JWT payload structure with the broader expectations of the OAuth 2.0 framework, facilitating a more standardized approach to scope handling across different components of the authentication and authorization flow.

vamsii777 commented 9 months ago