Skip to content

Commit

Permalink
Update the OAuth2 jwt and opaque resource server documentation with t…
Browse files Browse the repository at this point in the history
…he Lambda DSL

The OAuth2ResourceServerConfigurer::opaqueToken() and ::jwt() methods are deprecated since Spring Security 6.1
  • Loading branch information
arey authored and jzheaux committed Jul 9, 2024
1 parent beff600 commit f184d13
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,9 @@ public class DirectlyConfiguredJwkSetUri {
.requestMatchers("/messages/**").access(hasScope("messages"))
.anyRequest().authenticated()
)
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);
.oauth2ResourceServer(oauth2 -> oauth2
.jwt(Customizer.withDefaults())
);
return http.build();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.authorizeHttpRequests(authorize -> authorize
.anyRequest().authenticated()
)
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::opaqueToken);
.oauth2ResourceServer(oauth2 -> oauth2
.opaqueToken(Customizer.withDefaults())
);
return http.build();
}
----
Expand Down Expand Up @@ -564,7 +566,9 @@ public class MappedAuthorities {
.requestMatchers("/messages/**").access(hasScope("messages"))
.anyRequest().authenticated()
)
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::opaqueToken);
.oauth2ResourceServer(oauth2 -> oauth2
.opaqueToken(Customizer.withDefaults())
);
return http.build();
}
}
Expand Down

0 comments on commit f184d13

Please sign in to comment.