public final class JwtAuthenticator extends Object implements Authenticator<BearerCredential,JwtPrincipal>
Authenticator
which decodes and validates JsonWebSignature
s.Constructor and Description |
---|
JwtAuthenticator(List<JwtIssuer> issuers,
Collection<Constraint> constraints) |
Modifier and Type | Method and Description |
---|---|
JwtPrincipal |
authenticate(BearerCredential credential)
Given , return a
Principal . |
JwtPrincipal |
authenticate(BearerCredential credential,
SecurityContext context) |
public JwtAuthenticator(List<JwtIssuer> issuers, Collection<Constraint> constraints)
public JwtPrincipal authenticate(BearerCredential credential)
Principal
.
If the credential are valid returns a Principal
.
If the credential are invalid, throws AuthenticationException
.authenticate
in interface Authenticator<BearerCredential,JwtPrincipal>
credential
- subject credentialpublic JwtPrincipal authenticate(BearerCredential credential, SecurityContext context)