クラス LdapUserDetailsMapper

java.lang.ObjectSE
org.springframework.security.ldap.userdetails.LdapUserDetailsMapper
実装されたすべてのインターフェース:
UserDetailsContextMapper

public class LdapUserDetailsMapper extends ObjectSE implements UserDetailsContextMapper
LDAP 認証プロバイダーが LDAP ユーザーオブジェクトを作成するために使用するコンテキストマッパー。
  • コンストラクターの詳細

    • LdapUserDetailsMapper

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

    • mapUserFromContext

      public UserDetails mapUserFromContext(org.springframework.ldap.core.DirContextOperations ctx, StringSE username, CollectionSE<? extends GrantedAuthority> authorities)
      インターフェースからコピーされた説明: UserDetailsContextMapper
      セキュリティフレームワークで使用するために完全に読み込まれた UserDetails オブジェクトを作成します。
      次で指定:
      インターフェース UserDetailsContextMappermapUserFromContext 
      パラメーター:
      ctx - ユーザー情報を含むコンテキストオブジェクト。
      username - ユーザーが指定したログイン名。
      戻り値:
      ユーザーオブジェクト。
    • mapUserToContext

      public void mapUserToContext(UserDetails user, org.springframework.ldap.core.DirContextAdapter ctx)
      インターフェースからコピーされた説明: UserDetailsContextMapper
      上記の操作の逆。指定されたユーザーオブジェクトからコンテキストオブジェクトを作成します。たとえば、ユーザーを保存するときに呼び出されます。
      次で指定:
      インターフェース UserDetailsContextMappermapUserToContext 
    • mapPassword

      protected StringSE mapPassword(ObjectSE passwordValue)
      ディレクトリに格納されている属性からユーザーのパスワードをカスタマイズして作成できるようにする拡張ポイント。
      パラメーター:
      passwordValue - パスワード属性の値
      戻り値:
      パスワードの文字列表現。
    • createAuthority

      protected GrantedAuthority createAuthority(ObjectSE role)
      ロール属性から GrantedAuthority を作成します。権限オブジェクトの作成をカスタマイズするためにオーバーライドします。

      デフォルトの実装では、 rolePrefix および convertToUpperCase プロパティを使用して、文字列属性をロールに変換します。文字列以外の属性は無視されます。

      パラメーター:
      role - から返された属性
      戻り値:
      ユーザーの権限のリストに追加される権限。この属性を無視する必要がある場合は null
    • setConvertToUpperCase

      public void setConvertToUpperCase(boolean convertToUpperCase)
      ロード時にロールフィールド値を大文字に変換するかどうかを決定します。デフォルトは true です。
      パラメーター:
      convertToUpperCase - ロールを大文字に変換する必要がある場合は true。
    • setPasswordAttributeName

      public void setPasswordAttributeName(StringSE passwordAttributeName)
      ユーザーのパスワードを含む属性の名前。デフォルトは "userPassword" です。
      パラメーター:
      passwordAttributeName - 属性の名前
    • setRoleAttributes

      public void setRoleAttributes(StringSE[] roleAttributes)
      アプリケーションロールを表すユーザーのエントリ内の属性の名前。これらは GrantedAuthority に変換され、返された LdapUserDetails オブジェクトのリストに追加されます。属性値はデフォルトで文字列でなければなりません。
      パラメーター:
      roleAttributes - ロール属性の名前。
    • setRolePrefix

      public void setRolePrefix(StringSE rolePrefix)
      ロール名に適用されるプレフィックス
      パラメーター:
      rolePrefix - プレフィックス(デフォルトは "ROLE_" )。