Expected Behavior .formLogin() .loginPage("/login") .loginProcessingUrl("/j_spring_security_check") .usernameParameter("j_username") .passwordParameter("j_password") .defaultSuccessUrl("/main") .authorizationEndpoint() .authorizationRequestResolver( new CustomAuthorizationRequestResolver(this.clientRegistrationRepository))

Current Behavior

It only works in .oauth2Login()

.oauth2Login() .authorizationEndpoint() .authorizationRequestResolver( new CustomAuthorizationRequestResolver(this.clientRegistrationRepository)) Context

I also posted a question on "https://stackoverflow.com/questions/63438588/spring-security-oauth2-how-to-custom-authorization-code-access-token," but I only use formlogin() to do internal service. Here I want to customize the auth code, access token. However, the feature does not seem to be supported in FormLogin(). Also, I have to register and use ClientRegistrationRepository, which I do not use, but also use DB. So I wish I could customize an authorization request or token response without having to register like this.

Comment From: jgrandja

@bgc8214

Here I want to customize the auth code, access token. However, the feature does not seem to be supported in FormLogin()

formLogin() and oauth2Login() are completely different authentication mechanisms. Custom form login does not have a notion of an Authorization Endpoint so the features in oauth2Login() are not the same for formLogin().

I'm going to close this, given that you posted this question on Stack Overflow and we prefer to use GitHub issues only for bugs and enhancements.