Search in sources :

Example 1 with AnonymousCredentials

use of org.pac4j.core.credentials.AnonymousCredentials in project cas by apereo.

the class DelegatedClientAuthenticationHandlerTests method verifyMissingClient.

@Test
public void verifyMissingClient() {
    val facebookProfile = new FacebookProfile();
    facebookProfile.setId(ID);
    this.fbClient.setProfileCreator((oAuth20Credentials, webContext, sessionStore) -> Optional.of(facebookProfile));
    val cc = new ClientCredential(new AnonymousCredentials(), "UnknownClient");
    assertThrows(PreventedException.class, () -> this.handler.authenticate(cc));
}
Also used : lombok.val(lombok.val) ClientCredential(org.apereo.cas.authentication.principal.ClientCredential) AnonymousCredentials(org.pac4j.core.credentials.AnonymousCredentials) FacebookProfile(org.pac4j.oauth.profile.facebook.FacebookProfile) Test(org.junit.jupiter.api.Test)

Aggregations

lombok.val (lombok.val)1 ClientCredential (org.apereo.cas.authentication.principal.ClientCredential)1 Test (org.junit.jupiter.api.Test)1 AnonymousCredentials (org.pac4j.core.credentials.AnonymousCredentials)1 FacebookProfile (org.pac4j.oauth.profile.facebook.FacebookProfile)1