Skip to content

Commit f184d13

Browse files
areyjzheaux
authored andcommitted
Update the OAuth2 jwt and opaque resource server documentation with the Lambda DSL
The OAuth2ResourceServerConfigurer::opaqueToken() and ::jwt() methods are deprecated since Spring Security 6.1
1 parent beff600 commit f184d13

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

docs/modules/ROOT/pages/servlet/oauth2/resource-server/jwt.adoc

+3-1
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,9 @@ public class DirectlyConfiguredJwkSetUri {
879879
.requestMatchers("/messages/**").access(hasScope("messages"))
880880
.anyRequest().authenticated()
881881
)
882-
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);
882+
.oauth2ResourceServer(oauth2 -> oauth2
883+
.jwt(Customizer.withDefaults())
884+
);
883885
return http.build();
884886
}
885887
}

docs/modules/ROOT/pages/servlet/oauth2/resource-server/opaque-token.adoc

+6-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
204204
.authorizeHttpRequests(authorize -> authorize
205205
.anyRequest().authenticated()
206206
)
207-
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::opaqueToken);
207+
.oauth2ResourceServer(oauth2 -> oauth2
208+
.opaqueToken(Customizer.withDefaults())
209+
);
208210
return http.build();
209211
}
210212
----
@@ -564,7 +566,9 @@ public class MappedAuthorities {
564566
.requestMatchers("/messages/**").access(hasScope("messages"))
565567
.anyRequest().authenticated()
566568
)
567-
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::opaqueToken);
569+
.oauth2ResourceServer(oauth2 -> oauth2
570+
.opaqueToken(Customizer.withDefaults())
571+
);
568572
return http.build();
569573
}
570574
}

0 commit comments

Comments
 (0)