Examples of AuthenticationRequestPassword


Examples of org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword

        Assert.assertTrue(saipSqlAuthenticator.isValid(request));
    }

    @Test
    public void VerifyThatIsValidReturnsFalseForNoPassword() {
        final AuthenticationRequestPassword request = new AuthenticationRequestPassword("user1", "");
        Assert.assertFalse(saipSqlAuthenticator.isValid(request));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword

        Assert.assertFalse(saipSqlAuthenticator.isValid(request));
    }

    @Test
    public void VerifyThatIsValidReturnsFalseForWrongPassword() {
        final AuthenticationRequestPassword request = new AuthenticationRequestPassword("user1", "password12");
        Assert.assertFalse(saipSqlAuthenticator.isValid(request));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword

        Assert.assertFalse(saipSqlAuthenticator.isValid(request));
    }

    @Test
    public void VerifyThatIsValidReturnsFalseForWrongUsername() {
        final AuthenticationRequestPassword request = new AuthenticationRequestPassword("user", "password1");
        Assert.assertFalse(saipSqlAuthenticator.isValid(request));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword

        }
    }

    @Override
    public final boolean isValid(final AuthenticationRequest request) {
        final AuthenticationRequestPassword passwordRequest = (AuthenticationRequestPassword) request;
        final String username = passwordRequest.getName();
        if (Strings.isNullOrEmpty(username)) {
            return false;
        }
        final String password = passwordRequest.getPassword();
        Assert.assertNotNull(password);

        return isPasswordValidForUser(passwordRequest, username, password);

    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword

    @Override
    public void process(final RequestContext context) throws IOException {
        final String username = context.getParameter("username");
        final String password = context.getParameter("password");
        final AuthenticationSession session = UserManager.authenticate(new AuthenticationRequestPassword(username, password));

        String view;
        if (session == null) {
            final FormState formState = new FormState();
            formState.setError("Failed to login. Check the username and ensure that your password was entered correctly");
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword

        final String user = configuration.getString(SystemConstants.USER_KEY);
        final String password = configuration.getString(SystemConstants.PASSWORD_KEY);

        if (user != null) {
            authenticationRequestViaArgs = new AuthenticationRequestPassword(user, password);
        }
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword

        this.resourceStreamSource = configuration.getResourceStreamSource();
    }

    @Override
    public final boolean isValid(final AuthenticationRequest request) {
        final AuthenticationRequestPassword passwordRequest = (AuthenticationRequestPassword) request;
        final String username = passwordRequest.getName();
        if (Strings.isNullOrEmpty(username)) {
            return false;
        }
        final String password = passwordRequest.getPassword();
        Assert.assertNotNull(password);

        BufferedReader reader = null;
        try {
            final InputStream readStream = resourceStreamSource.readResource(FileAuthenticationConstants.PASSWORDS_FILE);
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword

    }

    @Test
    public void VerifyThatIsValidReturnsTrue() {
        final AuthenticationRequestPassword request = new AuthenticationRequestPassword("user1", "password1");
        Assert.assertTrue(saipSqlAuthenticator.isValid(request));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword

        Assert.assertTrue(saipSqlAuthenticator.isValid(request));
    }

    @Test
    public void VerifyThatIsValidReturnsTrueInMixedCase() {
        final AuthenticationRequestPassword request = new AuthenticationRequestPassword("uSer1", "password1");
        Assert.assertTrue(saipSqlAuthenticator.isValid(request));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword

    // Authentication
    // //////////////////////////////////////////////////////////////

    @Override
    public OpenSessionResponse openSession(final OpenSessionRequest request2) {
        final AuthenticationRequestPassword request = new AuthenticationRequestPassword(request2.getUsername(), request2.getPassword());
        final AuthenticationSession session = authenticationManager.authenticate(request);
        return new OpenSessionResponse(session);
    }
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.