Examples of AuthenticationRequestPassword


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

        request.setRoles(roles);
    }

    @Override
    public boolean isValid(final AuthenticationRequest request) {
        final AuthenticationRequestPassword passwordRequest = (AuthenticationRequestPassword) request;
        final String username = passwordRequest.getName();
        Assert.assertNotNull(username);
        if (username.equals("")) {
            LOG.debug("empty username");
            return false; // failed authentication
        }
        final String password = passwordRequest.getPassword();
        Assert.assertNotNull(password);

        final Hashtable<String, String> env = new Hashtable<String, String>(4);
        env.put(Context.INITIAL_CONTEXT_FACTORY, LdapAuthenticationConstants.SERVER_DEFAULT);
        env.put(Context.PROVIDER_URL, ldapProvider);
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 =
View Full Code Here

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

        final String password = httpServletRequest.getParameter("password");

        if (Strings.isNullOrEmpty(user) || Strings.isNullOrEmpty(password)) {
            return null;
        }
        final AuthenticationRequestPassword request = new AuthenticationRequestPassword(user, password);
        return IsisContext.getAuthenticationManager().authenticate(request);
    }
View Full Code Here

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

    }

    @Override
    public boolean authenticate(final String username, final String password) {
        AuthenticationRequest authenticationRequest;
        authenticationRequest = new AuthenticationRequestPassword(username, password);
        authenticationRequest.setRoles(Arrays.asList(USER_ROLE));
        authenticationSession = getAuthenticationManager().authenticate(authenticationRequest);
        return authenticationSession != null;
    }
View Full Code Here

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

        assertThat(authenticationManager.getAuthenticators().size(), is(0));
    }

    @Test(expected = NoAuthenticatorException.class)
    public void shouldNotBeAbleToAuthenticateWithNoAuthenticators() throws Exception {
        authenticationManager.authenticate(new AuthenticationRequestPassword("foo", "bar"));
    }
View Full Code Here

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

        final String password = httpServletRequest.getParameter("password");

        if (Strings.isNullOrEmpty(user) || Strings.isNullOrEmpty(password)) {
            return null;
        }
        final AuthenticationRequestPassword request = new AuthenticationRequestPassword(user, password);
        return IsisContext.getAuthenticationManager().authenticate(request);
    }
View Full Code Here

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

    private AuthenticationSession authenticate(final String user, final String password) {
        AuthenticationRequest request;
        if (IsisContext.getDeploymentType() == DeploymentType.EXPLORATION) {
            request = new AuthenticationRequestExploration();
        } else {
            request = new AuthenticationRequestPassword(user, password);
        }
        return getAuthenticationManager().authenticate(request);
    }
View Full Code Here

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

        });
    }

    @Test
    public void newlyCreatedAuthenticationSessionShouldBeValid() throws Exception {
        final AuthenticationRequestPassword request = new AuthenticationRequestPassword("foo", "bar");
        final AuthenticationSession session = authenticationManager.authenticate(request);

        assertThat(authenticationManager.isSessionValid(session), is(true));
    }
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
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.