クラス PreAuthenticatedGrantedAuthoritiesUserDetailsService

java.lang.ObjectSE
org.springframework.security.web.authentication.preauth.PreAuthenticatedGrantedAuthoritiesUserDetailsService
実装されたすべてのインターフェース:
AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken>

public class PreAuthenticatedGrantedAuthoritiesUserDetailsService extends ObjectSE implements AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken>

この AuthenticationUserDetailsService 実装は、指定された PreAuthenticatedAuthenticationToken に含まれる情報のみに基づいて UserDetails オブジェクトを作成します。ユーザー名は PreAuthenticatedAuthenticationToken.getName() によって返される名前に設定され、パスワードは固定のダミー値に設定され(PreAuthenticatedAuthenticationProvider では使用されません)、付与された権限は、返された詳細オブジェクトから取得されます。PreAuthenticatedAuthenticationToken.getDetails()

PreAuthenticatedAuthenticationToken.getDetails() によって返される詳細オブジェクトは、この実装が機能するために GrantedAuthoritiesContainer インターフェースを実装する必要があります。

導入:
2.0
  • コンストラクターの詳細

    • PreAuthenticatedGrantedAuthoritiesUserDetailsService

      public PreAuthenticatedGrantedAuthoritiesUserDetailsService()
  • メソッドの詳細

    • loadUserDetails

      public final UserDetails loadUserDetails(PreAuthenticatedAuthenticationToken token) throws AuthenticationException
      指定されたトークンに含まれるユーザー名に基づいて UserDetails オブジェクトを取得し、token.getDetails() メソッドによって返される GrantedAuthoritiesContainer 実装によって返される GrantedAuthorities を取得します。
      次で指定:
      インターフェース AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken>loadUserDetails 
      パラメーター:
      token - 事前認証された認証トークン
      戻り値:
      指定された認証トークンの UserDetails。null になることはありません。
      例外:
      UsernameNotFoundException - 指定された認証トークンのユーザー詳細が見つからない場合
      AuthenticationException
    • createUserDetails

      protected UserDetails createUserDetails(Authentication token, CollectionSE<? extends GrantedAuthority> authorities)
      最終的な UserDetails オブジェクトを作成します。オーバーライドしてコンテンツをカスタマイズできます。
      パラメーター:
      token - 認証リクエストトークン
      authorities - 事前認証された権限。