mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-08 05:02:13 +00:00
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
This commit is contained in:
parent
beff600d95
commit
f184d13096
@ -879,7 +879,9 @@ public class DirectlyConfiguredJwkSetUri {
|
|||||||
.requestMatchers("/messages/**").access(hasScope("messages"))
|
.requestMatchers("/messages/**").access(hasScope("messages"))
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
)
|
)
|
||||||
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);
|
.oauth2ResourceServer(oauth2 -> oauth2
|
||||||
|
.jwt(Customizer.withDefaults())
|
||||||
|
);
|
||||||
return http.build();
|
return http.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,9 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|||||||
.authorizeHttpRequests(authorize -> authorize
|
.authorizeHttpRequests(authorize -> authorize
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
)
|
)
|
||||||
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::opaqueToken);
|
.oauth2ResourceServer(oauth2 -> oauth2
|
||||||
|
.opaqueToken(Customizer.withDefaults())
|
||||||
|
);
|
||||||
return http.build();
|
return http.build();
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
@ -564,7 +566,9 @@ public class MappedAuthorities {
|
|||||||
.requestMatchers("/messages/**").access(hasScope("messages"))
|
.requestMatchers("/messages/**").access(hasScope("messages"))
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
)
|
)
|
||||||
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::opaqueToken);
|
.oauth2ResourceServer(oauth2 -> oauth2
|
||||||
|
.opaqueToken(Customizer.withDefaults())
|
||||||
|
);
|
||||||
return http.build();
|
return http.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user