Package org.apache.directory.server.changepw

Examples of org.apache.directory.server.changepw.ChangePasswordServer


    }
   
   
    private static void verifyServiceTicket( ChangePasswordContext changepwContext ) throws KerberosException
    {
        ChangePasswordServer config = changepwContext.getConfig();
        Ticket ticket = changepwContext.getTicket();
        String primaryRealm = config.getPrimaryRealm();
        KerberosPrincipal changepwPrincipal = config.getServicePrincipal();
        KerberosPrincipal serverPrincipal = ticket.getServerPrincipal();

        if ( !ticket.getRealm().equals( primaryRealm ) || !serverPrincipal.equals( changepwPrincipal ) )
        {
            throw new KerberosException( org.apache.directory.server.kerberos.shared.exceptions.ErrorType.KRB_AP_ERR_NOT_US );
View Full Code Here


    public void execute( NextCommand next, IoSession session, Object message ) throws Exception
    {
        ChangePasswordContext changepwContext = ( ChangePasswordContext ) session.getAttribute( getContextKey() );

        ChangePasswordServer config = changepwContext.getConfig();
        Authenticator authenticator = changepwContext.getAuthenticator();
        KerberosPrincipal clientPrincipal = authenticator.getClientPrincipal();

        String password = changepwContext.getPassword();
        String username = clientPrincipal.getName();

        int passwordLength = config.getPasswordLengthPolicy();
        int categoryCount = config.getCategoryCountPolicy();
        int tokenSize = config.getTokenSizePolicy();

        if ( !isValid( username, password, passwordLength, categoryCount, tokenSize ) )
        {
            String explanation = buildErrorMessage( username, password, passwordLength, categoryCount, tokenSize );
            log.error( explanation );
View Full Code Here

    /**
     * Creates a new instance of ChangepwProtocolHandlerTest.
     */
    public ChangepwProtocolHandlerTest()
    {
        config = new ChangePasswordServer();
        store = new MapPrincipalStoreImpl();
        handler = new ChangePasswordProtocolHandler( config, store );
        session = new ChPwdDummySession();
    }
View Full Code Here

    public void execute( NextCommand next, IoSession session, Object message ) throws Exception
    {
        ChangePasswordContext changepwContext = ( ChangePasswordContext ) session.getAttribute( getContextKey() );

        ChangePasswordServer config = changepwContext.getConfig();
        Authenticator authenticator = changepwContext.getAuthenticator();
        KerberosPrincipal clientPrincipal = KerberosUtils.getKerberosPrincipal(
            authenticator.getCName(), authenticator.getCRealm() );

        String password = changepwContext.getPassword();
        String username = clientPrincipal.getName();

        int passwordLength = config.getPasswordLengthPolicy();
        int categoryCount = config.getCategoryCountPolicy();
        int tokenSize = config.getTokenSizePolicy();

        if ( !isValid( username, password, passwordLength, categoryCount, tokenSize ) )
        {
            String explanation = buildErrorMessage( username, password, passwordLength, categoryCount, tokenSize );
            log.error( explanation );
View Full Code Here

    }
   
   
    private static void verifyServiceTicket( ChangePasswordContext changepwContext ) throws KerberosException
    {
        ChangePasswordServer config = changepwContext.getConfig();
        Ticket ticket = changepwContext.getTicket();
        String primaryRealm = config.getPrimaryRealm();
        KerberosPrincipal changepwPrincipal = config.getServicePrincipal();
        KerberosPrincipal serverPrincipal = ticket.getServerPrincipal();

        if ( !ticket.getRealm().equals( primaryRealm ) || !serverPrincipal.equals( changepwPrincipal ) )
        {
            throw new KerberosException( org.apache.directory.shared.kerberos.exceptions.ErrorType.KRB_AP_ERR_NOT_US );
View Full Code Here

     * Creates a new instance of ChangepwProtocolHandlerTest.
     */
    @BeforeClass
    public static void setup()
    {
        config = new ChangePasswordServer();
        store = new MapPrincipalStoreImpl();
        handler = new ChangePasswordProtocolHandler( config, store );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.changepw.ChangePasswordServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.