use of fish.payara.security.api.CertificateCredential in project Payara by payara.
the class CertificateRealmIdentityStore method validate.
public static CredentialValidationResult validate(CertificateCredential credential, String realmName) {
try {
Subject subject = login(credential, realmName);
Set<String> groups = subject.getPrincipals(Group.class).stream().map(g -> g.getName()).collect(toSet());
return new CredentialValidationResult(credential.getPrincipal(), groups);
} catch (LoginException ex) {
return INVALID_RESULT;
}
}
Aggregations