Examples of ExplorationAuthenticator


Examples of org.apache.isis.core.runtime.authentication.exploration.ExplorationAuthenticator

    @Override
    protected void addDefaultAuthenticators() {
        // we add to start to ensure that these special case authenticators
        // are always consulted first
        addAuthenticatorToStart(new ExplorationAuthenticator(getConfiguration()));
        addAuthenticatorToStart(new LogonFixtureAuthenticator(getConfiguration()));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.exploration.ExplorationAuthenticator

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

        session.setCurrentSession("sven");
        final List<String> roles = session.getRoles();
        Assert.assertEquals(3, roles.size());
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.exploration.ExplorationAuthenticator

        });

        explorationRequest = new AuthenticationRequestExploration();
        someOtherRequest = new SomeOtherAuthenticationRequest();

        authenticator = new ExplorationAuthenticator(mockConfiguration);
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.exploration.ExplorationAuthenticator

            {
                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("fred", session.getUserName());
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.exploration.ExplorationAuthenticator

            {
                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(), "xxx");

        Assert.assertEquals("xxx", session.getValidationCode());
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.exploration.ExplorationAuthenticator

            {
                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.runtime.authentication.exploration.ExplorationAuthenticator

            {
                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.runtime.authentication.exploration.ExplorationAuthenticator

            {
                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.runtime.authentication.exploration.ExplorationAuthenticator

            {
                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.USERS);
                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.runtime.authentication.exploration.ExplorationAuthenticator

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

        final Set<String> availableSessions = session.getUserNames();
        Assert.assertEquals(4, availableSessions.size());
        Assert.assertTrue(availableSessions.contains("fred"));
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.