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 https://github.com/spring-projects/spring-security/blob/62c5a25d5e713a7631d80eec266170eecc490fbd/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/server/DefaultServerOAuth2AuthorizationRequestResolver.java#L253-L255

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 https://github.com/spring-projects/spring-security/blob/62c5a25d5e713a7631d80eec266170eecc490fbd/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/DefaultOAuth2AuthorizationRequestResolver.java#L120

generates an "invalid" URL, because the code doesn't interfere: https://github.com/spring-projects/spring-security/blob/62c5a25d5e713a7631d80eec266170eecc490fbd/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/DefaultOAuth2AuthorizationRequestResolver.java#L250

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 coherent in both technologies

Comment From: chanbinme

take