Examples of AuthenticationSession


Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.USERS);
                will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
            }
        });
        authenticator = new ExplorationAuthenticator(mockConfiguration);
        final AuthenticationSession session = authenticator.authenticate(new AuthenticationRequestExploration(), "");

        Assert.assertEquals(0, session.getRoles().size());
    }
View Full Code Here

Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.USERS);
                will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
            }
        });
        authenticator = new ExplorationAuthenticator(mockConfiguration);
        final AuthenticationSession authSession = authenticator.authenticate(new AuthenticationRequestExploration(), "");

        assertThat(authSession, is(instanceOf(MultiUserExplorationSession.class)));

        assertThat(authSession.getUserName(), is(equalTo("fred")));
    }
View Full Code Here

Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.USERS);
                will(returnValue("sven"));
            }
        });
        authenticator = new ExplorationAuthenticator(mockConfiguration);
        final AuthenticationSession authSession = authenticator.authenticate(new AuthenticationRequestExploration(), "");
        assertThat(authSession, is(instanceOf(SimpleSession.class)));

        assertThat(authSession.getUserName(), is(equalTo("sven")));
    }
View Full Code Here

Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

                will(returnValue(null));
            }
        });
        authenticator = new ExplorationAuthenticator(mockConfiguration);

        final AuthenticationSession authSession = authenticator.authenticate(new AuthenticationRequestExploration(), "");
        assertThat(authSession, is(instanceOf(ExplorationSession.class)));
    }
View Full Code Here

Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

        final Collection<Authenticator> compatibleAuthenticators = Collections2.filter(authenticators, AuthenticatorFuncs.compatibleWith(request));
        if (compatibleAuthenticators.size() == 0) {
            throw new NoAuthenticatorException("No authenticator available for processing " + request.getClass().getName());
        }
        for (final Authenticator authenticator : compatibleAuthenticators) {
            final AuthenticationSession authSession = authenticator.authenticate(request, getUnusedRandomCode());
            if (authSession != null) {
                userByValidationCode.put(authSession.getValidationCode(), authSession.getUserName());
                return authSession;
            }
        }
        return null;
    }
View Full Code Here

Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

        super(type(), holder, Derivation.NOT_DERIVED);
    }

    @Override
    public String disables(final UsabilityContext<? extends UsabilityEvent> ic) {
        final AuthenticationSession session = ic.getSession();
        return disabledReason(session);
    }
View Full Code Here

Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

    // security
    // //////////////////////////////////////////////////////////////////

    @Override
    public UserMemento getUser() {
        final AuthenticationSession session = getAuthenticationSessionProvider().getAuthenticationSession();

        final String name = session.getUserName();
        final List<RoleMemento> roleMementos = asRoleMementos(session.getRoles());

        final UserMemento user = new UserMemento(name, roleMementos);
        return user;
    }
View Full Code Here

Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

        final InstallerLookup installerLookup = new InstallerLookup();
        isisConfigurationBuilder.injectInto(installerLookup);
        installerLookup.init();

        IsisSystemUsingInstallersWithinJunit system = null;
        AuthenticationSession session = null;
        try {
            // init the system; cf similar code in Isis and
            // IsisServletContextInitializer
            final DeploymentType deploymentType = DeploymentType.UNIT_TESTING;
View Full Code Here

Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

    //region > security

    @Programmatic
    @Override
    public UserMemento getUser() {
        final AuthenticationSession session = getAuthenticationSessionProvider().getAuthenticationSession();

        final String name = session.getUserName();
        final List<RoleMemento> roleMementos = asRoleMementos(session.getRoles());

        final UserMemento user = new UserMemento(name, roleMementos);
        return user;
    }
View Full Code Here

Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

        super(type(), holder, Derivation.NOT_DERIVED);
    }

    @Override
    public String disables(final UsabilityContext<? extends UsabilityEvent> ic) {
        final AuthenticationSession session = ic.getSession();
        return disabledReason(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.