インターフェース SecurityContext
- すべてのスーパーインターフェース:
java.io.Serializable
- すべての既知の実装クラス:
SecurityContextImpl
,TransientSecurityContext
public interface SecurityContext extends java.io.Serializable
現在の実行スレッドに関連付けられた最小限のセキュリティ情報を定義するインターフェース。セキュリティコンテキストは
SecurityContextHolder
に格納されます。
メソッドのサマリー
すべてのメソッド インスタンスメソッド 抽象メソッド 修飾子と型 メソッド 説明 Authentication
getAuthentication()
現在認証されているプリンシパル、または認証リクエストトークンを取得します。void
setAuthentication(Authentication authentication)
現在認証されているプリンシパルを変更するか、認証情報を削除します。
メソッドの詳細
getAuthentication
Authentication getAuthentication()
現在認証されているプリンシパル、または認証リクエストトークンを取得します。- 戻り値:
- 認証情報が利用できない場合は、
Authentication
またはnull
setAuthentication
void setAuthentication(Authentication authentication)
現在認証されているプリンシパルを変更するか、認証情報を削除します。- パラメーター:
authentication
- 新しいAuthentication
トークン、または認証情報をさらに保存する必要がない場合はnull