Module io.inverno.mod.security.jose
Package io.inverno.mod.security.jose.jwt
Class JWTSAuthentication<A extends JWTClaimsSet>
java.lang.Object
io.inverno.mod.security.jose.jwt.JWTSAuthentication<A>
- Type Parameters:
A- the JWT claims set type
- All Implemented Interfaces:
Authentication,TokenAuthentication
public class JWTSAuthentication<A extends JWTClaimsSet>
extends Object
implements TokenAuthentication
A token authentication that uses the compact representation of a JWTS as token value.
The authentication is considered authenticated when the underlying JWS is valid and is not using the NoAlgorithm.NONE algorithm.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Constructor Summary
ConstructorsConstructorDescriptionJWTSAuthentication(JWS<A> jwt) Creates a JWTS authentication with the specified JWT.Creates a denied JWTS authentication with the specified security error. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.security.authentication.Authentication
isAnonymous
-
Constructor Details
-
JWTSAuthentication
Creates a JWTS authentication with the specified JWT.
- Parameters:
jwt- a JWTS
-
JWTSAuthentication
Creates a denied JWTS authentication with the specified security error.
- Parameters:
cause- a security error or null
-
-
Method Details
-
getJwt
Returns the JWTS.
- Returns:
- a JWTS or null if unauthenticated
-
getJWTClaimsSet
Returns the JWT claims set.
- Returns:
- the JWT claims set or null if unauthenticated
-
getToken
Returns the JWTS compact representation.
- Specified by:
getTokenin interfaceTokenAuthentication- Returns:
- the JWTS compact representation or null if unauthenticated
-
isAuthenticated
public boolean isAuthenticated()- Specified by:
isAuthenticatedin interfaceAuthentication
-
getCause
- Specified by:
getCausein interfaceAuthentication
-