Class LdapRealm

  • All Implemented Interfaces:
    org.apache.shiro.authc.LogoutAware, org.apache.shiro.authz.Authorizer, org.apache.shiro.authz.permission.PermissionResolverAware, org.apache.shiro.authz.permission.RolePermissionResolverAware, org.apache.shiro.cache.CacheManagerAware, org.apache.shiro.realm.Realm, org.apache.shiro.util.Initializable, org.apache.shiro.util.Nameable

    public class LdapRealm
    extends org.apache.shiro.realm.ldap.AbstractLdapRealm
    Realm query Ldap to get users role
    • Field Summary

      • Fields inherited from class org.apache.shiro.realm.ldap.AbstractLdapRealm

        principalSuffix, searchBase, searchFilter, systemPassword, systemUsername, url
    • Constructor Summary

      Constructors 
      Constructor Description
      LdapRealm()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apache.shiro.authc.AuthenticationInfo queryForAuthenticationInfo​(org.apache.shiro.authc.AuthenticationToken token, org.apache.shiro.realm.ldap.LdapContextFactory ldapContextFactory)  
      protected org.apache.shiro.authz.AuthorizationInfo queryForAuthorizationInfo​(org.apache.shiro.subject.PrincipalCollection principals, org.apache.shiro.realm.ldap.LdapContextFactory ldapContextFactory)  
      void setGroupRequestFilter​(java.lang.String groupRequestFilter)
      set the group request filter, defined in shiro.ini
      void setGroupRolesMap​(java.util.Map<java.lang.String,​java.lang.String> groupRolesMap)
      set the map of group role, defined in shiro.ini
      void setUserDnTemplate​(java.lang.String userDnTemplate)
      set Template to convert username to dn, defined in shiro.ini
      • Methods inherited from class org.apache.shiro.realm.ldap.AbstractLdapRealm

        doGetAuthenticationInfo, doGetAuthorizationInfo, onInit, setLdapContextFactory, setPrincipalSuffix, setSearchBase, setSearchFilter, setSystemPassword, setSystemUsername, setUrl
      • Methods inherited from class org.apache.shiro.realm.AuthorizingRealm

        afterCacheManagerSet, checkPermission, checkPermission, checkPermission, checkPermissions, checkPermissions, checkPermissions, checkRole, checkRole, checkRoles, checkRoles, checkRoles, clearCachedAuthorizationInfo, doClearCache, getAuthorizationCache, getAuthorizationCacheKey, getAuthorizationCacheName, getAuthorizationInfo, getPermissionResolver, getPermissions, getRolePermissionResolver, hasAllRoles, hasRole, hasRole, hasRoles, hasRoles, isAuthorizationCachingEnabled, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isPermittedAll, setAuthorizationCache, setAuthorizationCacheName, setAuthorizationCachingEnabled, setName, setPermissionResolver, setRolePermissionResolver
      • Methods inherited from class org.apache.shiro.realm.AuthenticatingRealm

        assertCredentialsMatch, clearCachedAuthenticationInfo, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcher, supports
      • Methods inherited from class org.apache.shiro.realm.CachingRealm

        clearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabled
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.shiro.util.Initializable

        init
    • Constructor Detail

      • LdapRealm

        public LdapRealm()
    • Method Detail

      • setGroupRequestFilter

        public void setGroupRequestFilter​(java.lang.String groupRequestFilter)
        set the group request filter, defined in shiro.ini
        Parameters:
        groupRequestFilter -
      • setGroupRolesMap

        public void setGroupRolesMap​(java.util.Map<java.lang.String,​java.lang.String> groupRolesMap)
        set the map of group role, defined in shiro.ini
        Parameters:
        groupRolesMap -
      • setUserDnTemplate

        public void setUserDnTemplate​(java.lang.String userDnTemplate)
        set Template to convert username to dn, defined in shiro.ini
        Parameters:
        userDnTemplate -
      • queryForAuthenticationInfo

        protected org.apache.shiro.authc.AuthenticationInfo queryForAuthenticationInfo​(org.apache.shiro.authc.AuthenticationToken token,
                                                                                       org.apache.shiro.realm.ldap.LdapContextFactory ldapContextFactory)
                                                                                throws javax.naming.NamingException
        Specified by:
        queryForAuthenticationInfo in class org.apache.shiro.realm.ldap.AbstractLdapRealm
        Throws:
        javax.naming.NamingException
      • queryForAuthorizationInfo

        protected org.apache.shiro.authz.AuthorizationInfo queryForAuthorizationInfo​(org.apache.shiro.subject.PrincipalCollection principals,
                                                                                     org.apache.shiro.realm.ldap.LdapContextFactory ldapContextFactory)
                                                                              throws javax.naming.NamingException
        Specified by:
        queryForAuthorizationInfo in class org.apache.shiro.realm.ldap.AbstractLdapRealm
        Throws:
        javax.naming.NamingException