Search in sources :

Example 1 with TokenCredentials

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

the class AbstractTokenWrapperAuthenticationHandler method convertToPac4jCredentials.

@Override
protected TokenCredentials convertToPac4jCredentials(final BasicIdentifiableCredential casCredential) throws GeneralSecurityException, PreventedException {
    LOGGER.debug("CAS credentials: [{}]", casCredential);
    final String id = this.principalNameTransformer.transform(casCredential.getId());
    if (id == null) {
        throw new AccountNotFoundException("Id is null.");
    }
    final TokenCredentials credentials = new TokenCredentials(id, getClass().getSimpleName());
    LOGGER.debug("pac4j credentials: [{}]", credentials);
    return credentials;
}
Also used : AccountNotFoundException(javax.security.auth.login.AccountNotFoundException) TokenCredentials(org.pac4j.core.credentials.TokenCredentials)

Aggregations

AccountNotFoundException (javax.security.auth.login.AccountNotFoundException)1 TokenCredentials (org.pac4j.core.credentials.TokenCredentials)1