Skip to content

OAuth2Login behaves differently in MVC and Reactive #16941

Open
@joaquinjsb

Description

@joaquinjsb

Expected Behavior

When switching between MVC and Reactive variants, the behavior of the oauth2login should likely be the same, when using token relay with Spring Cloud Gateway.

Current Behavior

the DefaultOAuth2AuthorizationRequestResolver doesn't alter the defaultAction when the client grant is authorization code, the reactive stack changes the action urimap variable.
Context

if (AuthorizationGrantType.AUTHORIZATION_CODE.equals(clientRegistration.getAuthorizationGrantType())) {
action = "login";
}

so when I'm using my tokenRelay in reactive spring cloud gateway, everything works as expected, but when working with MVC, the generated url, which starts here

generates an "invalid" URL, because the code doesn't interfere:

when calling "authorize" signature generates this url:
/authorize/oauth2/code/{registrationId}......
while calling "login" generates a "valid" one:
/login/oauth2/code/{registrationId}....

*of course modifying manually the redirect-uri of the client solves the issue, but would be nice if the behavior is
valid

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions