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;
}
Aggregations