File tree Expand file tree Collapse file tree
gateway-oauth2-login/auth-server/src/main/java/com/relive/config
oauth2-custom-consent-page-with-vue/openid-provider/src/main/java/com/relive/config
oauth2-introspection-with-jwt/oauth2-server-introspction-with-jwt/src/main/java/com/relive/config
oauth2-jwt/oauth2-server/src/main/java/com/relive/config
oauth2-login/authorizationserver/src/main/java/com/relive/config
oauth2-opaque-token/oauth2-server-with-opaque-token/src/main/java/com/relive/config
oauth2-persistence-client/oauth2server/src/main/java/com/relive/config
oauth2-pkce/pkce-oauth2-server/src/main/java/com/relive/config
oidc-login/idp/src/main/java/com/relive/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import org .springframework .security .config .Customizer ;
1414import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
1515import org .springframework .security .config .annotation .web .configuration .OAuth2AuthorizationServerConfiguration ;
16- import org .springframework .security .config .annotation .web .configurers .ExpressionUrlAuthorizationConfigurer ;
1716import org .springframework .security .config .annotation .web .configurers .oauth2 .server .authorization .OAuth2AuthorizationServerConfigurer ;
1817import org .springframework .security .config .annotation .web .configurers .oauth2 .server .resource .OAuth2ResourceServerConfigurer ;
1918import org .springframework .security .oauth2 .core .AuthorizationGrantType ;
@@ -59,9 +58,9 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity h
5958
6059 return http .requestMatcher (endpointsMatcher )
6160 .authorizeRequests ((authorizeRequests ) -> {
62- (( ExpressionUrlAuthorizationConfigurer . AuthorizedUrl ) authorizeRequests .anyRequest () ).authenticated ();
61+ authorizeRequests .anyRequest ().authenticated ();
6362 }).csrf ((csrf ) -> {
64- csrf .ignoringRequestMatchers (new RequestMatcher []{ endpointsMatcher } );
63+ csrf .ignoringRequestMatchers (endpointsMatcher );
6564 }).apply (authorizationServerConfigurer )
6665 .and ()
6766 .oauth2ResourceServer (OAuth2ResourceServerConfigurer ::jwt )
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ ClientRegistrationRepository clientRegistrationRepository(JdbcTemplate jdbcTempl
9393 .clientAuthenticationMethod (ClientAuthenticationMethod .CLIENT_SECRET_BASIC )
9494 .authorizationGrantType (AuthorizationGrantType .AUTHORIZATION_CODE )
9595 .redirectUri ("{baseUrl}/{action}/oauth2/code/{registrationId}" )
96- .scope (new String []{ "read:user" } )
96+ .scope ("read:user" )
9797 .authorizationUri ("https://github.com/login/oauth/authorize" )
9898 .tokenUri ("https://github.com/login/oauth/access_token" )
9999 .userInfoUri ("https://api.github.com/user" )
Original file line number Diff line number Diff line change 1414import org .springframework .security .authentication .ProviderManager ;
1515import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
1616import org .springframework .security .config .annotation .web .configuration .OAuth2AuthorizationServerConfiguration ;
17- import org .springframework .security .config .annotation .web .configurers .ExpressionUrlAuthorizationConfigurer ;
1817import org .springframework .security .config .annotation .web .configurers .oauth2 .server .authorization .OAuth2AuthorizationServerConfigurer ;
1918import org .springframework .security .oauth2 .core .AuthorizationGrantType ;
2019import org .springframework .security .oauth2 .core .ClientAuthenticationMethod ;
@@ -81,9 +80,9 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity h
8180 RequestMatcher endpointsMatcher = authorizationServerConfigurer .getEndpointsMatcher ();
8281
8382 return http .requestMatcher (endpointsMatcher ).authorizeRequests ((authorizeRequests ) -> {
84- (( ExpressionUrlAuthorizationConfigurer . AuthorizedUrl ) authorizeRequests .anyRequest () ).authenticated ();
83+ authorizeRequests .anyRequest ().authenticated ();
8584 }).csrf ((csrf ) -> {
86- csrf .ignoringRequestMatchers (new RequestMatcher []{ endpointsMatcher } );
85+ csrf .ignoringRequestMatchers (endpointsMatcher );
8786 }).apply (authorizationServerConfigurer )
8887 .and ()
8988 .addFilterBefore (new BearerTokenAuthenticationFilter (
Original file line number Diff line number Diff line change @@ -32,9 +32,8 @@ SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Excepti
3232
3333 @ Bean
3434 UserDetailsService users () {
35- UserDetails user = User .withDefaultPasswordEncoder ()
36- .username ("admin" )
37- .password ("password" )
35+ UserDetails user = User .withUsername ("admin" )
36+ .password ("{noop}password" )
3837 .roles ("USER" )
3938 .build ();
4039 return new InMemoryUserDetailsManager (user );
Original file line number Diff line number Diff line change @@ -35,9 +35,8 @@ SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Excepti
3535
3636 @ Bean
3737 UserDetailsService users () {
38- UserDetails user = User .withDefaultPasswordEncoder ()
39- .username ("admin" )
40- .password ("password" )
38+ UserDetails user = User .withUsername ("admin" )
39+ .password ("{noop}password" )
4140 .roles ("USER" )
4241 .build ();
4342 return new InMemoryUserDetailsManager (user );
Original file line number Diff line number Diff line change @@ -43,9 +43,8 @@ public JwtDecoder jwtDecoder(JWKSource<SecurityContext> jwkSource) {
4343
4444 @ Bean
4545 public UserDetailsService users () {
46- UserDetails user = User .withDefaultPasswordEncoder ()
47- .username ("admin" )
48- .password ("password" )
46+ UserDetails user = User .withUsername ("admin" )
47+ .password ("{noop}password" )
4948 .roles ("ADMIN" )
5049 .build ();
5150 return new InMemoryUserDetailsManager (user );
Original file line number Diff line number Diff line change @@ -32,9 +32,8 @@ SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Excepti
3232
3333 @ Bean
3434 UserDetailsService users () {
35- UserDetails user = User .withDefaultPasswordEncoder ()
36- .username ("admin" )
37- .password ("password" )
35+ UserDetails user = User .withUsername ("admin" )
36+ .password ("{noop}password" )
3837 .roles ("ADMIN" )
3938 .build ();
4039 return new InMemoryUserDetailsManager (user );
Original file line number Diff line number Diff line change @@ -35,9 +35,8 @@ SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Excepti
3535
3636 @ Bean
3737 UserDetailsService users () {
38- UserDetails user = User .withDefaultPasswordEncoder ()
39- .username ("admin" )
40- .password ("password" )
38+ UserDetails user = User .withUsername ("admin" )
39+ .password ("{noop}password" )
4140 .roles ("USER" )
4241 .build ();
4342 return new InMemoryUserDetailsManager (user );
Original file line number Diff line number Diff line change @@ -32,9 +32,8 @@ SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Excepti
3232
3333 @ Bean
3434 UserDetailsService users () {
35- UserDetails user = User .withDefaultPasswordEncoder ()
36- .username ("admin" )
37- .password ("password" )
35+ UserDetails user = User .withUsername ("admin" )
36+ .password ("{noop}password" )
3837 .roles ("USER" )
3938 .build ();
4039 return new InMemoryUserDetailsManager (user );
Original file line number Diff line number Diff line change 1313import org .springframework .core .annotation .Order ;
1414import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
1515import org .springframework .security .config .annotation .web .configuration .OAuth2AuthorizationServerConfiguration ;
16- import org .springframework .security .config .annotation .web .configurers .ExpressionUrlAuthorizationConfigurer ;
1716import org .springframework .security .config .annotation .web .configurers .oauth2 .server .authorization .OAuth2AuthorizationServerConfigurer ;
1817import org .springframework .security .config .annotation .web .configurers .oauth2 .server .resource .OAuth2ResourceServerConfigurer ;
1918import org .springframework .security .oauth2 .core .AuthorizationGrantType ;
@@ -69,9 +68,9 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity h
6968 RequestMatcher endpointsMatcher = authorizationServerConfigurer .getEndpointsMatcher ();
7069
7170 return http .requestMatcher (endpointsMatcher ).authorizeRequests ((authorizeRequests ) -> {
72- (( ExpressionUrlAuthorizationConfigurer . AuthorizedUrl ) authorizeRequests .anyRequest () ).authenticated ();
71+ authorizeRequests .anyRequest ().authenticated ();
7372 }).csrf ((csrf ) -> {
74- csrf .ignoringRequestMatchers (new RequestMatcher []{ endpointsMatcher } );
73+ csrf .ignoringRequestMatchers (endpointsMatcher );
7574 }).apply (authorizationServerConfigurer )
7675 .and ()
7776 .oauth2ResourceServer (OAuth2ResourceServerConfigurer ::jwt )
You can’t perform that action at this time.
0 commit comments