Examples of ChangePasswordServer


Examples of org.apache.changepw.ChangePasswordServer

            {
                try
                {
                    ChangePasswordConfiguration changePasswordConfiguration = new ChangePasswordConfiguration( env, LoadStrategy.PROPS );
                    PrincipalStore store = new JndiPrincipalStoreImpl( changePasswordConfiguration, this );
                    changePasswordServer = new ChangePasswordServer( changePasswordConfiguration, minaRegistry, store );
                }
                catch ( Throwable t )
                {
                    log.error( "Failed to start the Change Password service", t );
                }
View Full Code Here

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

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

    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

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

    /**
     * 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

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

    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

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.shared.kerberos.exceptions.ErrorType.KRB_AP_ERR_NOT_US );
View Full Code Here

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

     * 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

Examples of org.apache.directory.server.kerberos.changepwd.ChangePasswordServer

            CreateChngPwdServer createChngPwdServer = createChngPwdServers[0];
            ChangePasswordConfig config = new ChangePasswordConfig( kdcConfig );
            config.setServicePrincipal( createChngPwdServer.srvPrincipal() );

            ChangePasswordServer chngPwdServer = new ChangePasswordServer( config );

            for ( CreateTransport transportBuilder : createChngPwdServer.transports() )
            {
                Transport t = createTransport( transportBuilder, startPort );
                startPort = t.getPort() + 1;
                chngPwdServer.addTransports( t );
            }

            chngPwdServer.setDirectoryService( directoryService );

            kdcServer.setChangePwdServer( chngPwdServer );
        }

        kdcServer.setDirectoryService( directoryService );
View Full Code Here

Examples of org.apache.directory.server.kerberos.changepwd.ChangePasswordServer

        ChangePasswordServerBean changePasswordServerBean = directoryServiceBean.getChangePasswordServerBean();

        // Fist, do nothing if the ChangePasswordServer is disabled
        if ( ( changePasswordServerBean != null ) && !changePasswordServerBean.isDisabled() )
        {
            ChangePasswordServer changePasswordServer = new ChangePasswordServer( new ChangePasswordConfig( kdcConfig ) );
            changePasswordServer.setEnabled( true );
            changePasswordServer.setDirectoryService( directoryService );

            // Transports
            Transport[] chngPwdTransports = createTransports( changePasswordServerBean.getTransports() );
            changePasswordServer.setTransports( chngPwdTransports );

            kdcServer.setChangePwdServer( changePasswordServer );
        }

        return kdcServer;
View Full Code Here

Examples of org.apache.directory.server.kerberos.changepwd.ChangePasswordServer

        ChangePasswordServerBean changePasswordServerBean = directoryServiceBean.getChangePasswordServerBean();

        // Fist, do nothing if the ChangePasswordServer is disabled
        if ( ( changePasswordServerBean != null ) && !changePasswordServerBean.isDisabled() )
        {
            ChangePasswordServer changePasswordServer = new ChangePasswordServer( new ChangePasswordConfig( kdcConfig ) );
            changePasswordServer.setEnabled( true );
            changePasswordServer.setDirectoryService( directoryService );

            // Transports
            Transport[] chngPwdTransports = createTransports( changePasswordServerBean.getTransports() );
            changePasswordServer.setTransports( chngPwdTransports );

            kdcServer.setChangePwdServer( changePasswordServer );
        }

        return kdcServer;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.