クラス OAuth2AuthorizationManagers
java.lang.ObjectSE
org.springframework.security.oauth2.core.authorization.OAuth2AuthorizationManagers
OAuth 2.0 固有の
AuthorizationManager
を作成するための便利なクラス。- 導入:
- 6.2
- 関連事項:
メソッドのサマリー
修飾子と型メソッド説明static <T> AuthorizationManager<T>
hasAnyScope
(StringSE... scopes) Authentication
がSCOPE_scope1
、SCOPE_scope2
、... の中から少なくとも 1 つの権限を持つことを要求するAuthorizationManager
を作成します。static <T> AuthorizationManager<T>
メソッドの詳細
hasScope
Authentication
がSCOPE_scope
権限を持つことを必要とするAuthorizationManager
を作成します。例:
hasScope("read")
を呼び出す場合、各認証には値がSCOPE_read
であるGrantedAuthority
が必要になります。これは
AuthorityAuthorizationManager#hasAuthority("SCOPE_read")
を呼び出すことと同じです。- 型パラメーター:
T
- 安全なオブジェクト- パラメーター:
scope
- 必要なスコープ値- 戻り値:
"SCOPE_scope"
権限を必要とするAuthorizationManager
hasAnyScope
Authentication
がSCOPE_scope1
、SCOPE_scope2
、...SCOPE_scopeN
のうち少なくとも 1 つの権限を持つことを要求するAuthorizationManager
を作成します。例:
hasAnyScope("read", "write")
を呼び出す場合、各認証には少なくともSCOPE_read
またはSCOPE_write
の値を持つGrantedAuthority
が必要になります。これは
AuthorityAuthorizationManager#hasAnyAuthority("SCOPE_read", "SCOPE_write")
を呼び出すことと同じです。- 型パラメーター:
T
- 安全なオブジェクト- パラメーター:
scopes
- 許可するスコープ値- 戻り値:
"SCOPE_scope1"
、SCOPE_scope2
、...SCOPE_scopeN
のうち少なくとも 1 つの権限を必要とするAuthorizationManager
。