Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document missing OAuth2LoginAuthenticationFilter set AuthorizationRequestRepository #13098

Closed
BingChunMoLi opened this issue Apr 26, 2023 · 1 comment
Assignees
Labels
in: docs An issue in Documentation or samples type: bug A general bug
Milestone

Comments

@BingChunMoLi
Copy link

gh-13090

@Configuration
@EnableWebSecurity
public class OAuth2ClientSecurityConfig {

	@Bean
	public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
		http
			.oauth2Client(oauth2 -> oauth2
				.authorizationCodeGrant(codeGrant -> codeGrant
					.authorizationRequestRepository(this.authorizationRequestRepository())
					...
				)
                       .oauth2Login(oauth2 -> oauth2
                               .authorizationEndpoint(endpoint -> endpoint
                                      .authorizationRequestRepository(this.authorizationRequestRepository())
                                      ...
                               )
             ).build();
    }

    @Bean
    public AuthorizationRequestRepository<OAuth2AuthorizationRequest> authorizationRequestRepository() {
        return new CustomOAuth2AuthorizationRequestRepository();
    }
}
@jzheaux
Copy link
Contributor

jzheaux commented May 18, 2023

Closed in b6f3cb7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: docs An issue in Documentation or samples type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants