Class OAuth2ReactiveAuthorizationManagers
java.lang.Object
org.springframework.security.oauth2.core.authorization.OAuth2ReactiveAuthorizationManagers
A convenience class for creating OAuth 2.0-specific
AuthorizationManagers.- Since:
- 6.2
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ReactiveAuthorizationManager<T>hasAnyScope(String... scopes) Create aReactiveAuthorizationManagerthat requires anAuthenticationto have at least one authority amongSCOPE_scope1,SCOPE_scope2, ...static <T> ReactiveAuthorizationManager<T>Create aReactiveAuthorizationManagerthat requires anAuthenticationto have aSCOPE_scopeauthority.
-
Method Details
-
hasScope
Create aReactiveAuthorizationManagerthat requires anAuthenticationto have aSCOPE_scopeauthority.For example, if you call
hasScope("read"), then this will require that each authentication have aGrantedAuthoritywhose value isSCOPE_read.This would equivalent to calling
AuthorityReactiveAuthorizationManager#hasAuthority("SCOPE_read").- Type Parameters:
T- the secure object- Parameters:
scope- the scope value to require- Returns:
- an
ReactiveAuthorizationManagerthat requires a"SCOPE_scope"authority
-
hasAnyScope
Create aReactiveAuthorizationManagerthat requires anAuthenticationto have at least one authority amongSCOPE_scope1,SCOPE_scope2, ...SCOPE_scopeN.For example, if you call
hasAnyScope("read", "write"), then this will require that each authentication have at least aGrantedAuthoritywhose value is eitherSCOPE_readorSCOPE_write.This would equivalent to calling
AuthorityReactiveAuthorizationManager#hasAnyAuthority("SCOPE_read", "SCOPE_write").- Type Parameters:
T- the secure object- Parameters:
scopes- the scope values to allow- Returns:
- an
ReactiveAuthorizationManagerthat requires at least one authority among"SCOPE_scope1",SCOPE_scope2, ...SCOPE_scopeN.
-