[MM-66681] Update path matching (#34524)

This commit is contained in:
Ben Cooke 2025-11-19 09:50:25 -05:00 committed by GitHub
parent 7727f8f33b
commit 188b57fbcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -29,7 +29,8 @@ const (
func (w *Web) InitOAuth() {
// OAuth 2.0 Authorization Server Metadata endpoint (RFC 8414)
w.MainRouter.Handle(model.OAuthMetadataEndpoint, w.APIHandlerTrustRequester(getAuthorizationServerMetadata)).Methods(http.MethodGet)
// Match the exact path and any path with additional segments after it
w.MainRouter.PathPrefix(model.OAuthMetadataEndpoint).Handler(w.APIHandlerTrustRequester(getAuthorizationServerMetadata)).Methods(http.MethodGet)
// API version independent OAuth 2.0 as a service provider endpoints
w.MainRouter.Handle(model.OAuthAuthorizeEndpoint, w.APIHandlerTrustRequester(authorizeOAuthPage)).Methods(http.MethodGet)

View file

@ -58,7 +58,8 @@ func GetDefaultMetadata(siteURL string) (*AuthorizationServerMetadata, error) {
GrantTypeRefreshToken,
},
TokenEndpointAuthMethodsSupported: []string{
ClientAuthMethodClientSecretPost,
ClientAuthMethodNone, // Public clients (PKCE)
ClientAuthMethodClientSecretPost, // Confidential clients
},
ScopesSupported: []string{
ScopeUser,