Class JwtAuthenticationProvider
java.lang.Object
com.codename1.backend.security.oauth2.server.resource.JwtAuthenticationProvider
- All Implemented Interfaces:
AuthenticationProvider
Authenticates a bearer token by verifying it as a JWT.
A token the decoder refuses is an InvalidBearerTokenException carrying
the decoder's reason, which the entry point sends back as invalid_token.
A token the decoder could not judge -- the issuer's keys could not be
fetched -- is an AuthenticationServiceException: the server's failure, and
not reported to the caller as a bad token.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(Authentication authentication) The accepted authentication, or null when this provider cannot decide and the next one should be asked.voidsetJwtAuthenticationConverter(Converter<Jwt, ? extends AbstractAuthenticationToken> jwtAuthenticationConverter) What makes an authentication of a verified token; aJwtAuthenticationConverterunless set.booleanWhether this provider checks tokens of this class.
-
Constructor Details
-
JwtAuthenticationProvider
-
-
Method Details
-
setJwtAuthenticationConverter
public void setJwtAuthenticationConverter(Converter<Jwt, ? extends AbstractAuthenticationToken> jwtAuthenticationConverter) What makes an authentication of a verified token; aJwtAuthenticationConverterunless set. -
authenticate
Description copied from interface:AuthenticationProviderThe accepted authentication, or null when this provider cannot decide and the next one should be asked.
Throws
AuthenticationException: when the token is refused
- Specified by:
authenticatein interfaceAuthenticationProvider
-
supports
Description copied from interface:AuthenticationProviderWhether this provider checks tokens of this class.- Specified by:
supportsin interfaceAuthenticationProvider
-