Tabnine Logo
DefaultLdapRealm.getContextFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
getContextFactory
method
in
org.apache.shiro.realm.ldap.DefaultLdapRealm

Best Java code snippets using org.apache.shiro.realm.ldap.DefaultLdapRealm.getContextFactory (Showing top 5 results out of 315)

origin: apache/shiro

protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
  AuthorizationInfo info;
  try {
    info = queryForAuthorizationInfo(principals, getContextFactory());
  } catch (NamingException e) {
    String msg = "LDAP naming error while attempting to retrieve authorization for user [" + principals + "].";
    throw new AuthorizationException(msg, e);
  }
  return info;
}
origin: apache/shiro

/**
 * Delegates to {@link #queryForAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken, LdapContextFactory)},
 * wrapping any {@link NamingException}s in a Shiro {@link AuthenticationException} to satisfy the parent method
 * signature.
 *
 * @param token the authentication token containing the user's principal and credentials.
 * @return the {@link AuthenticationInfo} acquired after a successful authentication attempt
 * @throws AuthenticationException if the authentication attempt fails or if a
 *                                 {@link NamingException} occurs.
 */
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
  AuthenticationInfo info;
  try {
    info = queryForAuthenticationInfo(token, getContextFactory());
  } catch (AuthenticationNotSupportedException e) {
    String msg = "Unsupported configured authentication mechanism";
    throw new UnsupportedAuthenticationMechanismException(msg, e);
  } catch (javax.naming.AuthenticationException e) {
    throw new AuthenticationException("LDAP authentication failed.", e);
  } catch (NamingException e) {
    String msg = "LDAP naming error while attempting to authenticate user.";
    throw new AuthenticationException(msg, e);
  }
  return info;
}
origin: apache/shiro

@Test
public void testDefaultInstance() {
  assertTrue(realm.getCredentialsMatcher() instanceof AllowAllCredentialsMatcher);
  assertEquals(AuthenticationToken.class, realm.getAuthenticationTokenClass());
  assertTrue(realm.getContextFactory() instanceof JndiLdapContextFactory);
}
origin: org.apache.shiro/shiro-core

protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
  AuthorizationInfo info;
  try {
    info = queryForAuthorizationInfo(principals, getContextFactory());
  } catch (NamingException e) {
    String msg = "LDAP naming error while attempting to retrieve authorization for user [" + principals + "].";
    throw new AuthorizationException(msg, e);
  }
  return info;
}
origin: org.apache.shiro/shiro-core

/**
 * Delegates to {@link #queryForAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken, LdapContextFactory)},
 * wrapping any {@link NamingException}s in a Shiro {@link AuthenticationException} to satisfy the parent method
 * signature.
 *
 * @param token the authentication token containing the user's principal and credentials.
 * @return the {@link AuthenticationInfo} acquired after a successful authentication attempt
 * @throws AuthenticationException if the authentication attempt fails or if a
 *                                 {@link NamingException} occurs.
 */
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
  AuthenticationInfo info;
  try {
    info = queryForAuthenticationInfo(token, getContextFactory());
  } catch (AuthenticationNotSupportedException e) {
    String msg = "Unsupported configured authentication mechanism";
    throw new UnsupportedAuthenticationMechanismException(msg, e);
  } catch (javax.naming.AuthenticationException e) {
    throw new AuthenticationException("LDAP authentication failed.", e);
  } catch (NamingException e) {
    String msg = "LDAP naming error while attempting to authenticate user.";
    throw new AuthenticationException(msg, e);
  }
  return info;
}
org.apache.shiro.realm.ldapDefaultLdapRealmgetContextFactory

Javadoc

Returns the LdapContextFactory instance used to acquire connections to the LDAP directory during authentication attempts and authorization queries. Unless specified otherwise, the default is a JndiLdapContextFactoryinstance.

Popular methods of DefaultLdapRealm

  • getUserDn
    Returns the LDAP User Distinguished Name (DN) to use when acquiring an javax.naming.ldap.LdapContext
  • queryForAuthenticationInfo
    This implementation opens an LDAP connection using the token's #getLdapPrincipal(org.apache.shiro.au
  • <init>
    Default no-argument constructor that defaults the internal LdapContextFactory instance to a JndiLdap
  • createAuthenticationInfo
    Returns the AuthenticationInfo resulting from a Subject's successful LDAP authentication attempt. Th
  • doGetAuthenticationInfo
    Delegates to #queryForAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken,LdapContextFacto
  • doGetAuthorizationInfo
  • getAuthenticationInfo
  • getAuthenticationTokenClass
  • getCredentialsMatcher
  • getLdapPrincipal
    Returns the principal to use when creating the LDAP connection for an authentication attempt. This i
  • getName
  • getUserDnPrefix
    Returns the User DN prefix to use when building a runtime User DN value or null if no #getUserDnTemp
  • getName,
  • getUserDnPrefix,
  • getUserDnSuffix,
  • getUserDnTemplate,
  • queryForAuthorizationInfo,
  • setAuthenticationTokenClass,
  • setContextFactory,
  • setCredentialsMatcher,
  • setUserDnTemplate

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • setScale (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • Menu (java.awt)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now