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

🐛 Configures OAuth 2.0 Resource Server support. #1551

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(
new LoginUrlAuthenticationEntryPoint("/login"),
new MediaTypeRequestMatcher(MediaType.TEXT_HTML)
)
)
.oauth2ResourceServer(oauth2ResourceServer ->
Copy link
Collaborator

@jgrandja jgrandja Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be removed as oauth2ResourceServer() should be configured with the authorizationServerSecurityFilterChain() NOT the defaultSecurityFilterChain().

This sample works as expected.

oauth2ResourceServer.jwt(Customizer.withDefaults()));
);
// @formatter:on
return http.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws
.loginPage("/login")
.successHandler(authenticationSuccessHandler())
);

http.oauth2ResourceServer(oauth2ResourceServer ->
oauth2ResourceServer.jwt(Customizer.withDefaults()));
return http.build();
}
// @formatter:on
Expand Down
Loading