Examples of AuthenticationRequestPassword


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

        });
    }

    @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

        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

     * {@link #isValid(AuthenticationRequest)} and then returns a
     * {@link SimpleSession}.
     */
    @Override
    public AuthenticationSession authenticate(final AuthenticationRequest authRequest, final String code) {
        final AuthenticationRequestPassword passwordRequest = (AuthenticationRequestPassword) authRequest;
        final String username = passwordRequest.getName();
        if (StringUtils.isNullOrEmpty(username)) {
            return null;
        }
        final String password = passwordRequest.getPassword();

        final OpenSessionRequest request = new OpenSessionRequest(username, password);
        final OpenSessionResponse response = serverFacade.openSession(request);
        return response.getSession();
    }
View Full Code Here

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

    protected AuthenticationSession authenticate(final String user, final String password) {
        AuthenticationRequest request;
        if (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

        } else if (widget == login || widget == password) {
            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            instructionLabel.setText("Authorising...");
            instructionLabel.setForeground(Color.BLACK);

            final AuthenticationRequestPassword authenticationRequest = new AuthenticationRequestPassword(getUser(), getPassword());
            session = authenticationManager.authenticate(authenticationRequest);
            if (session == null) {
                try {
                    Thread.sleep(750);
                } catch (final InterruptedException ignore) {
View Full Code Here

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

        }

        final String user = matcher.group(1);
        final String password = matcher.group(2);

        final AuthenticationSession authSession = getAuthenticationManager().authenticate(new AuthenticationRequestPassword(user, password));
        return authSession;
    }
View Full Code Here

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

     * Compare to the {@link AuthenticatorAbstract#authenticate(AuthenticationRequest, String) default implementation}
     * which calls {@link #isValid(AuthenticationRequest)} and then returns a {@link SimpleSession}.
     */
    @Override
    public AuthenticationSession authenticate(final AuthenticationRequest authRequest, final String code) {
        final AuthenticationRequestPassword passwordRequest = (AuthenticationRequestPassword) authRequest;
        final String username = passwordRequest.getName();
        if (StringUtils.isNullOrEmpty(username)) {
            return null;
        }
        final String password = passwordRequest.getPassword();

        final OpenSessionRequest request = new OpenSessionRequest(username, password);
        final OpenSessionResponse response = serverFacade.openSession(request);
        return response.getSession();
    }
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

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

        } else if (widget == login || widget == password) {
            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            instructionLabel.setText("Authorising...");
            instructionLabel.setForeground(Color.BLACK);

            final AuthenticationRequestPassword authenticationRequest =
                new AuthenticationRequestPassword(getUser(), getPassword());
            session = authenticationManager.authenticate(authenticationRequest);
            if (session == null) {
                try {
                    Thread.sleep(750);
                } catch (final InterruptedException ignore) {
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.