Tabnine Logo
LdapPrincipal.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.directory.server.core.api.LdapPrincipal
constructor

Best Java code snippets using org.apache.directory.server.core.api.LdapPrincipal.<init> (Showing top 13 results out of 315)

origin: org.apache.knox/gateway-test-ldap

/**
 * Get back an anonymous session
 */
public CoreSession getSession()
{
 return new DefaultCoreSession( new LdapPrincipal( schemaManager ), this );
}
origin: org.apache.directory.server/apacheds-core-api

LdapPrincipal principal = new LdapPrincipal( schemaManager, dn, authenticationLevel );
origin: org.apache.directory.server/apacheds-core-integ

public static CoreSession getCoreSession( String principalDn, DirectoryService service, String dn )
  throws LdapException
{
  if ( principalDn == null )
  {
    principalDn = "";
  }
  Dn userDn = new Dn( service.getSchemaManager(), principalDn );
  LdapPrincipal principal = new LdapPrincipal( service.getSchemaManager(), userDn, AuthenticationLevel.SIMPLE );
  CoreSession session = service.getSession( principal );
  
  return session;
}
origin: org.apache.directory.server/apacheds-core-shared

/**
 * Creates a new instance of a DefaultCoreSession
 * @param principal The principal to use to process operation for this session
 * @param directoryService The DirectoryService to which we will send requests
 */
public DefaultCoreSession( LdapPrincipal principal, DirectoryService directoryService )
{
  this.directoryService = directoryService;
  authenticatedPrincipal = principal;
  if ( principal.getAuthenticationLevel() == AuthenticationLevel.NONE )
  {
    anonymousPrincipal = principal;
  }
  else
  {
    anonymousPrincipal = new LdapPrincipal( directoryService.getSchemaManager() );
  }
  // setup attribute type value
  objectClassAT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
}
origin: org.apache.directory.server/apacheds-core-integ

public static LdapContext getContext( String principalDn, DirectoryService service, String dn )
  throws Exception
{
  if ( principalDn == null )
  {
    principalDn = "";
  }
  Dn userDn = new Dn( service.getSchemaManager(), principalDn );
  LdapPrincipal principal = new LdapPrincipal( service.getSchemaManager(), userDn, AuthenticationLevel.SIMPLE );
  if ( dn == null )
  {
    dn = "";
  }
  CoreSession session = service.getSession( principal );
  LdapContext ctx = new ServerLdapContext( service, session, new LdapName( dn ) );
  return ctx;
}
origin: org.apache.directory.server/apacheds-interceptors-authn

  /**
   * User has already been authenticated during SASL negotiation. Set the authentication level
   * to strong and return an {@link LdapPrincipal}.
   */
  @Override
  public LdapPrincipal authenticate( BindOperationContext bindContext ) throws LdapAuthenticationException
  {
    // Possibly check if user account is disabled, other account checks.
    LdapPrincipal principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindContext.getDn(),
      AuthenticationLevel.STRONG );

    IoSession session = bindContext.getIoSession();

    if ( session != null )
    {
      SocketAddress clientAddress = session.getRemoteAddress();
      principal.setClientAddress( clientAddress );
      SocketAddress serverAddress = session.getServiceAddress();
      principal.setServerAddress( serverAddress );
    }

    return principal;
  }
}
origin: org.apache.directory.server/apacheds-protocol-ldap

  protected void authorize( AuthorizeCallback authorizeCB ) throws Exception
  {
    LOG.debug( "Processing conversion of principal name to Dn." );

    String username = authorizeCB.getAuthorizationID();

    // find the user's entry
    GetPrincipal getPrincipal = new GetPrincipal( new KerberosPrincipal( username ) );
    PrincipalStoreEntry entry = ( PrincipalStoreEntry ) getPrincipal.execute( adminSession, new Dn( ldapSession
      .getLdapServer().getSearchBaseDn() ) );
    String bindDn = entry.getDistinguishedName();

    LOG.debug( "Converted username {} to Dn {}.", username, bindDn );

    LdapPrincipal ldapPrincipal = new LdapPrincipal( adminSession.getDirectoryService().getSchemaManager(),
      new Dn( entry.getDistinguishedName() ),
      AuthenticationLevel.STRONG, Strings.EMPTY_BYTES );
    ldapSession.putSaslProperty( SaslConstants.SASL_AUTHENT_USER, ldapPrincipal );
    ldapSession.putSaslProperty( Context.SECURITY_PRINCIPAL, bindDn );

    authorizeCB.setAuthorizedID( bindDn );
    authorizeCB.setAuthorized( true );
  }
}
origin: org.apache.knox/gateway-test-ldap

adminSession = new DefaultCoreSession( new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.STRONG ),
  this );
origin: org.apache.directory.server/apacheds-protocol-ldap

LdapPrincipal ldapPrincipal = new LdapPrincipal(
  schemaManager,
  entry.getDn(),
origin: org.apache.directory.server/apacheds-protocol-ldap

LdapPrincipal ldapPrincipal = new LdapPrincipal(
  schemaManager,
  entry.getDn(),
origin: org.apache.directory.server/apacheds-interceptors-authn

principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindContext.getDn(),
  AuthenticationLevel.SIMPLE );
principal.setUserPassword( storedPasswords );
origin: org.apache.directory.server/apacheds-protocol-ldap

LdapPrincipal ldapPrincipal = new LdapPrincipal( getAdminSession().getDirectoryService()
  .getSchemaManager(),
  dn, AuthenticationLevel.STRONG );
origin: org.apache.directory.server/apacheds-interceptors-authn

principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindDn,
  AuthenticationLevel.SIMPLE,
  bindContext.getCredentials() );
org.apache.directory.server.core.apiLdapPrincipal<init>

Javadoc

Creates a principal for the no name anonymous user whose Dn is the empty String.

Popular methods of LdapPrincipal

  • getName
    Returns the normalized distinguished name of the principal as a String.
  • getDn
    Gets a cloned copy of the normalized distinguished name of this principal as a org.apache.directory.
  • getAuthenticationLevel
    Gets the authentication level associated with this LDAP principle.
  • getUserPasswords
  • setUserPassword
  • clone
    Clone the object. This is done so that we don't store the password in a LdapPrincipal more than nece
  • setClientAddress
  • setSchemaManager
  • setServerAddress

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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