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

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


        // final SpecificationLoader mockSpecificationLoader =
        // mockery.mock(SpecificationLoader.class);
        // final PersistenceSessionFactory mockPersistenceSessionFactory =
        // mockery.mock(PersistenceSessionFactory.class);
        final UserProfileLoader mockUserProfileLoader = mockery.mock(UserProfileLoader.class);
        final AuthenticationManager mockAuthenticationManager = mockery.mock(AuthenticationManager.class);
        final AuthorizationManager mockAuthorizationManager = mockery.mock(AuthorizationManager.class);

        mockery.checking(new Expectations() {
            {
                ignoring(mockTemplateImageLoader);
View Full Code Here


        servicesList = new ArrayList<Object>();
        servicesList.add(factory);

        final TemplateImageLoader mockTemplateImageLoader = mockery.mock(TemplateImageLoader.class);
        final UserProfileLoader mockUserProfileLoader = mockery.mock(UserProfileLoader.class);
        final AuthenticationManager mockAuthenticationManager = mockery.mock(AuthenticationManager.class);
        final AuthorizationManager mockAuthorizationManager = mockery.mock(AuthorizationManager.class);

        mockery.checking(new Expectations() {
            {
                ignoring(mockTemplateImageLoader);
View Full Code Here

     * method}.
     */
    protected final IsisSessionFactory createSessionFactory(final DeploymentType deploymentType, final UserProfileLoader userProfileLoader, final PersistenceSessionFactory persistenceSessionFactory) throws IsisSystemException {

        final IsisConfiguration configuration = getConfiguration();
        final AuthenticationManager authenticationManager = obtainAuthenticationManager(deploymentType);
        final AuthorizationManager authorizationManager = obtainAuthorizationManager(deploymentType);
        final TemplateImageLoader templateImageLoader = obtainTemplateImageLoader();
        final ObjectReflector reflector = obtainReflector(deploymentType);

        final List<Object> servicesList = obtainServices();
View Full Code Here

public class AuthenticationSessionStrategyDefault extends AuthenticationSessionStrategyAbstract {

    @Override
    public AuthenticationSession lookupValid(final ServletRequest servletRequest, final ServletResponse servletResponse) {

        final AuthenticationManager authenticationManager = getAuthenticationManager();
        final HttpSession httpSession = getHttpSession(servletRequest);

        // use previously authenticated session if available
        AuthenticationSession authSession = (AuthenticationSession) httpSession.getAttribute(WebAppConstants.HTTP_SESSION_AUTHENTICATION_SESSION_KEY);
        if (authSession != null) {
            final boolean sessionValid = authenticationManager.isSessionValid(authSession);
            if (sessionValid) {
                return authSession;
            }
        }

        // otherwise, look for LogonFixture and try to authenticate
        final ServletContext servletContext = getServletContext(servletRequest);
        final IsisSystem system = (IsisSystem) servletContext.getAttribute(WebAppConstants.ISIS_SYSTEM_KEY);
        if (system == null) {
            // not expected to happen...
            return null;
        }
        final LogonFixture logonFixture = system.getLogonFixture();

        // see if exploration is supported
        if (system.getDeploymentType().isExploring()) {
            authSession = authenticationManager.authenticate(new AuthenticationRequestExploration(logonFixture));
            if (authSession != null) {
                return authSession;
            }
        }

        final boolean loggedInUsingLogonFixture = httpSession.getAttribute(WebAppConstants.HTTP_SESSION_LOGGED_ON_PREVIOUSLY_USING_LOGON_FIXTURE_KEY) != null;
        if (logonFixture != null && !loggedInUsingLogonFixture) {
            httpSession.setAttribute(WebAppConstants.HTTP_SESSION_LOGGED_ON_PREVIOUSLY_USING_LOGON_FIXTURE_KEY, true);
            return authenticationManager.authenticate(new AuthenticationRequestLogonFixture(logonFixture));
        }

        return null;
    }
View Full Code Here

    // Wicket Hooks
    // /////////////////////////////////////////////////

    @Override
    public Session newSession(final Request request, final Response response) {
        final AuthenticationManager authenticationManager = anonymousAuthenticationManager();

        final AnonymousWebSessionForIsis anonymousWebSession = new AnonymousWebSessionForIsis(request, authenticationManager);
        anonymousWebSession.authenticate(null, null);
        return anonymousWebSession;
    }
View Full Code Here

        final TemplateImageLoader mockTemplateImageLoader = mockery.mock(TemplateImageLoader.class);
        // final SpecificationLoader mockSpecificationLoader = mockery.mock(SpecificationLoader.class);
        // final PersistenceSessionFactory mockPersistenceSessionFactory =
        // mockery.mock(PersistenceSessionFactory.class);
        final UserProfileLoader mockUserProfileLoader = mockery.mock(UserProfileLoader.class);
        final AuthenticationManager mockAuthenticationManager = mockery.mock(AuthenticationManager.class);
        final AuthorizationManager mockAuthorizationManager = mockery.mock(AuthorizationManager.class);

        mockery.checking(new Expectations() {
            {
                ignoring(mockTemplateImageLoader);
View Full Code Here

    protected final IsisSessionFactory createSessionFactory(final DeploymentType deploymentType,
        final UserProfileLoader userProfileLoader, final PersistenceSessionFactory persistenceSessionFactory)
        throws IsisSystemException {

        final IsisConfiguration configuration = getConfiguration();
        final AuthenticationManager authenticationManager = obtainAuthenticationManager(deploymentType);
        final AuthorizationManager authorizationManager = obtainAuthorizationManager(deploymentType);
        final TemplateImageLoader templateImageLoader = obtainTemplateImageLoader();
        final ObjectReflector reflector = obtainReflector(deploymentType);

        final List<Object> servicesList = obtainServices();
View Full Code Here

        servicesList = new ArrayList<Object>();
        servicesList.add(factory);

        final TemplateImageLoader mockTemplateImageLoader = mockery.mock(TemplateImageLoader.class);
        final UserProfileLoader mockUserProfileLoader = mockery.mock(UserProfileLoader.class);
        final AuthenticationManager mockAuthenticationManager = mockery.mock(AuthenticationManager.class);
        final AuthorizationManager mockAuthorizationManager = mockery.mock(AuthorizationManager.class);

        mockery.checking(new Expectations() {
            {
                ignoring(mockTemplateImageLoader);
View Full Code Here

    // Wicket Hooks
    // /////////////////////////////////////////////////

    @Override
    public Session newSession(final Request request, final Response response) {
        final AuthenticationManager authenticationManager = anonymousAuthenticationManager();

        final AnonymousWebSessionForIsis anonymousWebSession =
            new AnonymousWebSessionForIsis(request, authenticationManager);
        anonymousWebSession.authenticate(null, null);
        return anonymousWebSession;
View Full Code Here

public class Fixture_AuthenticationManager_AuthenticateOk extends MockFixtureAdapter<AuthenticationManager> {

    @Override
    public void setUp(final MockFixture.Context fixtureContext) {
        final Mockery mockery = fixtureContext.getMockery();
        final AuthenticationManager mock = createMock(fixtureContext, AuthenticationManager.class);
        mockery.checking(new Expectations() {
            {
                one(mock).authenticate(with(any(AuthenticationRequest.class)));
            }
        });
View Full Code Here

TOP

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

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.