Package org.apache.isis.core.runtime.authentication

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


     * TODO: there is similar code in
     * <tt>AuthenticationSessionLookupStrategyDefault</tt>; should try to
     * combine somehow...
     */
    private boolean login() {
        final AuthenticationRequest request = determineRequestIfPossible();

        // we may have enough to get a session
        AuthenticationSession session = getAuthenticationManager().authenticate(request);
        clearAuthenticationRequestViaArgs();

View Full Code Here


    }

    private AuthenticationRequest determineRequestIfPossible() {

        // command line args
        AuthenticationRequest request = getAuthenticationRequestViaArgs();
        ;

        // exploration & (optionally) logon fixture provided
        if (request == null) {
            if (getDeploymentType().isExploring()) {
View Full Code Here

    /**
     * TODO: there is similar code in <tt>AuthenticationSessionLookupStrategyDefault</tt>; should try to combine
     * somehow...
     */
    private boolean login() {
        final AuthenticationRequest request = determineRequestIfPossible();

        // we may have enough to get a session
        AuthenticationSession session = getAuthenticationManager().authenticate(request);
        clearAuthenticationRequestViaArgs();

View Full Code Here

    }

    private AuthenticationRequest determineRequestIfPossible() {
       
        // command line args
        AuthenticationRequest request = getAuthenticationRequestViaArgs();;

        // exploration & (optionally) logon fixture provided
        if (request == null) {
            if (getDeploymentType().isExploring()) {
                request = new AuthenticationRequestExploration(getLogonFixture());
View Full Code Here

        super(Ensure.ensureThatArg(request, is(not(nullValue(Request.class)))));
    }

    @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

            system = new IsisSystemUsingInstallersWithinJunit(deploymentType, installerLookup, testClass);

            system.init();

            // specific to this bootstrap mechanism
            AuthenticationRequest request;
            final LogonFixture logonFixture = system.getFixturesInstaller().getLogonFixture();
            if (logonFixture != null) {
                request = new AuthenticationRequestLogonFixture(logonFixture);
            } else {
                request = new AuthenticationRequestExploration(logonFixture);
View Full Code Here

        LOG.info("created session: " + httpSession);
        loggedIn(response, user);
    }

    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);
        }
View Full Code Here

        super(Ensure.ensureThatArg(request, is(not(nullValue(Request.class)))));
    }

    @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

        SecurityUtils.setSecurityManager(securityManager);

       
        assertThat(authOrAuth.canAuthenticate(AuthenticationRequestPassword.class), is(true));

        AuthenticationRequest ar = new AuthenticationRequestPassword("lonestarr", "vespa");
        AuthenticationSession isisAuthSession = authOrAuth.authenticate(ar, null);

        assertThat(isisAuthSession, is(not(nullValue())));
        assertThat(isisAuthSession.getUserName(), is("lonestarr"));
        assertThat(isisAuthSession.getValidationCode(), is(nullValue()));
View Full Code Here

        // given
        Factory<SecurityManager> factory = new IniSecurityManagerFactory("classpath:shiro.ini");
        SecurityManager securityManager = factory.getInstance();
        SecurityUtils.setSecurityManager(securityManager);

        AuthenticationRequest ar = new AuthenticationRequestPassword("darkhelmet", "ludicrousspeed");
        authOrAuth.authenticate(ar, null);

        // when, then
        Identifier changeAddressIdentifier = Identifier.actionIdentifier("com.mycompany.myapp.Customer", "changeAddress", String.class, String.class);
        assertThat(authOrAuth.isVisibleInAnyRole(changeAddressIdentifier), is(true));
View Full Code Here

TOP

Related Classes of org.apache.isis.core.runtime.authentication.AuthenticationRequest

Copyright © 2018 www.massapicom. 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.