use of org.pac4j.core.profile.AnonymousProfile in project pac4j by pac4j.
the class IsAuthenticatedAuthorizerTests method testCommonProfileTwoProfiles.
@Test
public void testCommonProfileTwoProfiles() {
profiles.add(new AnonymousProfile());
profiles.add(profile);
assertTrue(authorizer.isAuthorized(null, new MockSessionStore(), profiles));
}
use of org.pac4j.core.profile.AnonymousProfile in project pac4j by pac4j.
the class DefaultAuthorizationCheckerTests method testIsAnonymous.
@Test
public void testIsAnonymous() {
profiles.clear();
profiles.add(new AnonymousProfile());
assertTrue(checker.isAuthorized(null, new MockSessionStore(), profiles, DefaultAuthorizers.IS_ANONYMOUS, new HashMap<>(), new ArrayList<>()));
}
use of org.pac4j.core.profile.AnonymousProfile in project pac4j by pac4j.
the class IsAuthenticatedAuthorizerTests method testAnonymousProfileRedirectionUrl.
@Test
public void testAnonymousProfileRedirectionUrl() {
profiles.add(new AnonymousProfile());
((IsAuthenticatedAuthorizer) authorizer).setRedirectionUrl(PAC4J_URL);
TestsHelper.expectException(() -> authorizer.isAuthorized(MockWebContext.create(), new MockSessionStore(), profiles), HttpAction.class, "Performing a 302 HTTP action");
}
use of org.pac4j.core.profile.AnonymousProfile in project pac4j by pac4j.
the class IsAnonymousAuthorizerTests method testTwoAnonProfiles.
@Test
public void testTwoAnonProfiles() {
profiles.add(new AnonymousProfile());
profiles.add(new AnonymousProfile());
assertTrue(authorizer.isAuthorized(null, new MockSessionStore(), profiles));
}
use of org.pac4j.core.profile.AnonymousProfile in project pac4j by pac4j.
the class IsFullyAuthenticatedAuthorizerTests method testAnonymousProfileRedirectionUrl.
@Override
@Test
public void testAnonymousProfileRedirectionUrl() {
profiles.add(new AnonymousProfile());
((IsFullyAuthenticatedAuthorizer) authorizer).setRedirectionUrl(PAC4J_URL);
TestsHelper.expectException(() -> authorizer.isAuthorized(MockWebContext.create(), new MockSessionStore(), profiles), HttpAction.class, "Performing a 302 HTTP action");
}
Aggregations