クラス AbstractAuthenticationToken
java.lang.ObjectSE
org.springframework.security.authentication.AbstractAuthenticationToken
- 実装されているすべてのインターフェース:
SerializableSE
、PrincipalSE
、Authentication
、CredentialsContainer
- 既知の直属サブクラス
AbstractOAuth2TokenAuthenticationToken
、AnonymousAuthenticationToken
、BearerTokenAuthenticationToken
、CasAssertionAuthenticationToken
、CasAuthenticationToken
、CasServiceTicketAuthenticationToken
、DPoPAuthenticationToken
、KerberosServiceRequestToken
、OAuth2AccessTokenAuthenticationToken
、OAuth2AuthenticationToken
、OAuth2AuthorizationCodeAuthenticationToken
、OAuth2AuthorizationCodeRequestAuthenticationToken
、OAuth2AuthorizationConsentAuthenticationToken
、OAuth2AuthorizationGrantAuthenticationToken
、OAuth2ClientAuthenticationToken
、OAuth2DeviceAuthorizationRequestAuthenticationToken
、OAuth2DeviceVerificationAuthenticationToken
、OAuth2LoginAuthenticationToken
、OAuth2PushedAuthorizationRequestAuthenticationToken
、OAuth2TokenExchangeCompositeAuthenticationToken
、OAuth2TokenIntrospectionAuthenticationToken
、OAuth2TokenRevocationAuthenticationToken
、OidcClientRegistrationAuthenticationToken
、OidcLogoutAuthenticationToken
、OidcUserInfoAuthenticationToken
、OneTimeTokenAuthentication
、OneTimeTokenAuthenticationToken
、PreAuthenticatedAuthenticationToken
、RememberMeAuthenticationToken
、RunAsUserToken
、Saml2Authentication
、Saml2AuthenticationToken
、TestingAuthenticationToken
、UsernamePasswordAuthenticationToken
、WebAuthnAuthentication
、WebAuthnAuthenticationRequestToken
public abstract class AbstractAuthenticationToken
extends ObjectSE
implements Authentication, CredentialsContainer
Authentication
オブジェクトの基本クラス。このクラスを使用する実装は不変でなければなりません。
- 関連事項:
ネストされたクラスの要約
ネストされたクラス修飾子と型クラス説明protected static class
AbstractAuthenticationToken.AbstractAuthenticationBuilder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>
Authentication.Builder
の共通抽象実装。インターフェース org.springframework.security.core.Authentication から継承されたネストクラス / インターフェース
Authentication.Builder<B extends Authentication.Builder<B>>
コンストラクターの概要
コンストラクター修飾子コンストラクター説明AbstractAuthenticationToken
(@Nullable CollectionSE<? extends GrantedAuthority> authorities) 指定された権限の配列を使用してトークンを作成します。protected
メソッドのサマリー
修飾子と型メソッド説明boolean
void
CredentialsContainer
を実装するものに対してeraseCredentials
メソッドを呼び出して、credentials
、principal
、details
オブジェクトをチェックします。プリンシパルが許可されたことを権限に示すために、AuthenticationManager
によって設定されます。@Nullable ObjectSE
認証リクエストに関する追加の詳細を保存します。getName()
int
hashCode()
boolean
認証トークンをAuthenticationManager
に提示する必要があるかどうかをAbstractSecurityInterceptor
に示すために使用されます。void
setAuthenticated
(boolean authenticated) 詳細については、Authentication.isAuthenticated()
を参照してください。void
setDetails
(@Nullable ObjectSE details) toString()
クラス java.lang.ObjectSE から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, wait, waitSE, waitSE
インターフェース org.springframework.security.core.Authentication から継承されたメソッド
getCredentials, getPrincipal, toBuilder
インターフェース java.security.PrincipalSE から継承されたメソッド
impliesSE
コンストラクターの詳細
AbstractAuthenticationToken
指定された権限の配列を使用してトークンを作成します。- パラメーター:
authorities
- この認証オブジェクトによって表されるプリンシパルの GrantedAuthority のコレクション。
AbstractAuthenticationToken
protected AbstractAuthenticationToken(AbstractAuthenticationToken.AbstractAuthenticationBuilder<?> builder)
メソッドの詳細
getAuthorities
インターフェースからコピーされた説明:Authentication
プリンシパルが許可されたことを権限に示すために、AuthenticationManager
によって設定されます。信頼できるAuthenticationManager
によって設定されていない限り、クラスはこの値が有効であることに依存してはならないことに注意してください。実装では、返されたコレクション配列への変更が認証オブジェクトの状態に影響を与えないようにするか、変更不可能なインスタンスを使用する必要があります。
- 次で指定:
- インターフェース
Authentication
のgetAuthorities
- 戻り値:
- プリンシパルに付与された権限、またはトークンが認証されていない場合は空のコレクション。非 null。
getName
- 次で指定:
- インターフェース
PrincipalSE
のgetName
isAuthenticated
public boolean isAuthenticated()インターフェースからコピーされた説明:Authentication
認証トークンをAuthenticationManager
に提示する必要があるかどうかをAbstractSecurityInterceptor
に示すために使用されます。通常、AuthenticationManager
(または、より頻繁には、そのAuthenticationProvider
の 1 つ)は、認証が成功した後、不変の認証トークンを返します。この場合、トークンはtrue
をこのメソッドに安全に返すことができます。true
を返すとパフォーマンスが向上します。リクエストごとにAuthenticationManager
を呼び出す必要がなくなるためです。セキュリティ上の理由から、このインターフェースの実装は、不変であるか、元の作成以降プロパティが変更されていないことを保証する方法がない限り、このメソッドから
true
を返すことに十分注意する必要があります。- 次で指定:
- インターフェース
Authentication
のisAuthenticated
- 戻り値:
- トークンが認証され、
AbstractSecurityInterceptor
が再認証のために再度AuthenticationManager
にトークンを提示する必要がない場合は true。
setAuthenticated
public void setAuthenticated(boolean authenticated) インターフェースからコピーされた説明:Authentication
詳細については、Authentication.isAuthenticated()
を参照してください。実装では、このメソッドが
false
パラメーターで呼び出されることを常に許可する必要があります。これは、認証トークンを信頼しないように指定するためにさまざまなクラスで使用されるためです。実装がtrue
パラメーター (認証トークンが信頼されていることを示します - 潜在的なセキュリティリスク) を使用した呼び出しを拒否したい場合、実装はIllegalArgumentException
SE をスローする必要があります。- 次で指定:
- インターフェース
Authentication
のsetAuthenticated
- パラメーター:
authenticated
- トークンを信頼する必要がある場合はtrue
(例外が発生する可能性があります)、トークンを信頼しない場合はfalse
getDetails
インターフェースからコピーされた説明:Authentication
認証リクエストに関する追加の詳細を保存します。これらは、IP アドレス、証明書のシリアル番号などです。- 次で指定:
- インターフェース
Authentication
のgetDetails
- 戻り値:
- 認証リクエストに関する追加の詳細、または使用しない場合は
null
setDetails
eraseCredentials
public void eraseCredentials()CredentialsContainer
を実装するものに対してeraseCredentials
メソッドを呼び出して、credentials
、principal
、details
オブジェクトをチェックします。- 次で指定:
- インターフェース
CredentialsContainer
のeraseCredentials
equals
- 次で指定:
- インターフェース
PrincipalSE
のequalsSE
- オーバーライド:
- クラス
ObjectSE
のequalsSE
hashCode
public int hashCode()- 次で指定:
- インターフェース
PrincipalSE
のhashCode
- オーバーライド:
- クラス
ObjectSE
のhashCode
toString
- 次で指定:
- インターフェース
PrincipalSE
のtoString
- オーバーライド:
- クラス
ObjectSE
のtoString