クラス OAuth2DeviceAuthorizationConsentAuthenticationProvider
java.lang.ObjectSE
org.springframework.security.oauth2.server.authorization.authentication.OAuth2DeviceAuthorizationConsentAuthenticationProvider
- 実装済みのインターフェース一覧:
AuthenticationProvider
public final class OAuth2DeviceAuthorizationConsentAuthenticationProvider
extends ObjectSE
implements AuthenticationProvider
OAuth 2.0 デバイス認可付与で使用されるデバイス認可同意の
AuthenticationProvider 実装。- 導入:
- 7.0
- 関連事項:
OAuth2DeviceAuthorizationConsentAuthenticationTokenOAuth2AuthorizationConsentOAuth2DeviceAuthorizationRequestAuthenticationProviderOAuth2DeviceVerificationAuthenticationProviderOAuth2DeviceCodeAuthenticationProviderRegisteredClientRepositoryOAuth2AuthorizationServiceOAuth2AuthorizationConsentService
コンストラクター概要
コンストラクターコンストラクター説明OAuth2DeviceAuthorizationConsentAuthenticationProvider(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService, OAuth2AuthorizationConsentService authorizationConsentService) 指定されたパラメーターを使用してOAuth2DeviceAuthorizationConsentAuthenticationProviderを構築します。方法の概要
修飾子と型メソッド説明authenticate(Authentication authentication) AuthenticationManager.authenticate(Authentication)と同じ契約で認証を実行します。voidsetAuthorizationConsentCustomizer(ConsumerSE<OAuth2AuthorizationConsentAuthenticationContext> authorizationConsentCustomizer) OAuth2AuthorizationConsent.Builderおよび追加のコンテキスト情報を含むOAuth2AuthorizationConsentAuthenticationContextへのアクセスを提供するConsumerを設定します。booleanこのAuthenticationProviderが指定されたAuthenticationオブジェクトをサポートしている場合は、trueを返します。
コンストラクターの詳細
OAuth2DeviceAuthorizationConsentAuthenticationProvider
public OAuth2DeviceAuthorizationConsentAuthenticationProvider(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService, OAuth2AuthorizationConsentService authorizationConsentService) 指定されたパラメーターを使用してOAuth2DeviceAuthorizationConsentAuthenticationProviderを構築します。- パラメーター:
registeredClientRepository- 登録済みクライアントのリポジトリauthorizationService- 認可サービスauthorizationConsentService- 認可同意サービス
メソッドの詳細
authenticate
インターフェースからコピーされた説明:AuthenticationProviderAuthenticationManager.authenticate(Authentication)と同じ契約で認証を実行します。- 次で指定:
- インターフェース
AuthenticationProviderのauthenticate - パラメーター:
authentication- 認証リクエストオブジェクト。- 戻り値:
- 資格情報を含む完全に認証されたオブジェクト。
AuthenticationProviderが、渡されたAuthenticationオブジェクトの認証をサポートできない場合、nullを返すことがあります。そのような場合、提示されたAuthenticationクラスをサポートする次のAuthenticationProviderが試行されます。 - 例外:
AuthenticationException- 認証が失敗した場合。
supports
インターフェースからコピーされた説明:AuthenticationProviderこのAuthenticationProviderが指定されたAuthenticationオブジェクトをサポートする場合、trueを返します。trueを返しても、AuthenticationProviderが提示されたAuthenticationオブジェクトを認証できることは保証されません。これは単に、より詳細な評価をサポートできることを示しているだけです。AuthenticationProviderは、AuthenticationProvider.authenticate(Authentication)メソッドからnullを返して、別のAuthenticationProviderを試す必要があることを示すことができます。認証を実行できる
AuthenticationProviderの選択は、実行時にProviderManagerによって行われます。- 次で指定:
- インターフェース
AuthenticationProviderのsupports - 戻り値:
- 実装が提示された
Authenticationクラスをより厳密に評価できる場合はtrue
setAuthorizationConsentCustomizer
public void setAuthorizationConsentCustomizer(ConsumerSE<OAuth2AuthorizationConsentAuthenticationContext> authorizationConsentCustomizer) OAuth2AuthorizationConsent.Builderおよび追加のコンテキスト情報を含むOAuth2AuthorizationConsentAuthenticationContextへのアクセスを提供するConsumerを設定します。次のコンテキスト属性を使用できます。
OAuth2AuthorizationConsent.Builderは、OAuth2AuthorizationConsentService.save(OAuth2AuthorizationConsent)の前に認可同意を構築するために使用されました。- 型
OAuth2DeviceAuthorizationConsentAuthenticationTokenのAuthentication。 - デバイス認証リクエストに関連付けられた
RegisteredClient。 - デバイス認可同意リクエストで提示された状態トークンに関連付けられた
OAuth2Authorization。
- パラメーター:
authorizationConsentCustomizer-OAuth2AuthorizationConsent.Builderを含むOAuth2AuthorizationConsentAuthenticationContextへのアクセスを提供するConsumer