Examples of AuthenticationStatus


Examples of com.sun.enterprise.security.auth.AuthenticationStatus

     * authenticateUser calls authenticate which is implemented by the implementation
     * of this subclass
     * @throws LoginException
     */
    protected final void authenticateUser() throws LoginException{
        AuthenticationStatus as = authenticate();
        if(as.getStatus() == as.AUTH_SUCCESS)
            return;
        else{
            throw new LoginException();
        }
    }
View Full Code Here

Examples of com.sun.enterprise.security.auth.AuthenticationStatus

    {
        commitUserAuthentication(groups);
        int status = AuthenticationStatus.AUTH_SUCCESS;
        String realm = theRealm.getName();
        String authMethod = theRealm.getAuthType();
        AuthenticationStatus as =
            new AuthenticationStatusImpl(username, authMethod, realm, status);
        return as;
    }
View Full Code Here

Examples of org.keycloak.services.managers.AuthenticationManager.AuthenticationStatus

        }
    };

    @Test
    public void authForm() {
        AuthenticationStatus status = am.authenticateForm(session, dummyConnection, realm, formData);
        Assert.assertEquals(AuthenticationStatus.SUCCESS, status);
    }
View Full Code Here

Examples of org.keycloak.services.managers.AuthenticationManager.AuthenticationStatus

    @Test
    public void authFormInvalidPassword() {
        formData.remove(CredentialRepresentation.PASSWORD);
        formData.add(CredentialRepresentation.PASSWORD, "invalid");

        AuthenticationStatus status = am.authenticateForm(session, dummyConnection, realm, formData);
        Assert.assertEquals(AuthenticationStatus.INVALID_CREDENTIALS, status);
    }
View Full Code Here

Examples of org.keycloak.services.managers.AuthenticationManager.AuthenticationStatus

    @Test
    public void authFormMissingUsername() {
        formData.remove("username");

        AuthenticationStatus status = am.authenticateForm(session, dummyConnection, realm, formData);
        Assert.assertEquals(AuthenticationStatus.INVALID_USER, status);
    }
View Full Code Here

Examples of org.keycloak.services.managers.AuthenticationManager.AuthenticationStatus

    @Test
    public void authFormMissingPassword() {
        formData.remove(CredentialRepresentation.PASSWORD);

        AuthenticationStatus status = am.authenticateForm(session, dummyConnection, realm, formData);
        Assert.assertEquals(AuthenticationStatus.MISSING_PASSWORD, status);
    }
View Full Code Here

Examples of org.keycloak.services.managers.AuthenticationManager.AuthenticationStatus

    @Test
    public void authFormRequiredAction() {
        realm.addRequiredCredential(CredentialRepresentation.TOTP);
        user.addRequiredAction(RequiredAction.CONFIGURE_TOTP);

        AuthenticationStatus status = am.authenticateForm(session, dummyConnection, realm, formData);
        Assert.assertEquals(AuthenticationStatus.ACTIONS_REQUIRED, status);
    }
View Full Code Here

Examples of org.keycloak.services.managers.AuthenticationManager.AuthenticationStatus

    @Test
    public void authFormUserDisabled() {
        user.setEnabled(false);

        AuthenticationStatus status = am.authenticateForm(session, dummyConnection, realm, formData);
        Assert.assertEquals(AuthenticationStatus.ACCOUNT_DISABLED, status);
    }
View Full Code Here

Examples of org.keycloak.services.managers.AuthenticationManager.AuthenticationStatus

        String token = otp.generate(totpSecret);

        formData.add(CredentialRepresentation.TOTP, token);

        AuthenticationStatus status = am.authenticateForm(session, dummyConnection, realm, formData);
        Assert.assertEquals(AuthenticationStatus.SUCCESS, status);
    }
View Full Code Here

Examples of org.keycloak.services.managers.AuthenticationManager.AuthenticationStatus

        authFormWithTotp();

        formData.remove(CredentialRepresentation.PASSWORD);
        formData.add(CredentialRepresentation.PASSWORD, "invalid");

        AuthenticationStatus status = am.authenticateForm(session, dummyConnection, realm, formData);
        Assert.assertEquals(AuthenticationStatus.INVALID_CREDENTIALS, status);
    }
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.