Package org.entur.jwt.verifier
Class JwtClaimVerifier<T>
- java.lang.Object
-
- org.entur.jwt.verifier.JwtClaimVerifier<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.entur.jwt.jwk.JwksHealthProvider,JwtVerifier<T>
public class JwtClaimVerifier<T> extends java.lang.Object implements JwtVerifier<T>
-
-
Constructor Summary
Constructors Constructor Description JwtClaimVerifier(JwtVerifier<T> delegate, JwtClaimExtractor<T> extractor, java.util.Map<java.lang.String,java.lang.Class<?>> types, java.util.Map<java.lang.String,java.lang.Object> values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.entur.jwt.jwk.JwksHealthgetHealth(boolean refresh)Tverify(java.lang.String token)Verify token.protected voidverifyClaimTypes(T token)protected voidverifyClaimValues(T token)
-
-
-
Constructor Detail
-
JwtClaimVerifier
public JwtClaimVerifier(JwtVerifier<T> delegate, JwtClaimExtractor<T> extractor, java.util.Map<java.lang.String,java.lang.Class<?>> types, java.util.Map<java.lang.String,java.lang.Object> values)
-
-
Method Detail
-
verify
public T verify(java.lang.String token) throws JwtException, org.entur.jwt.jwk.JwksException
Description copied from interface:JwtVerifierVerify token. Non-valid tokens are assumed to be logged and returned as null. Exceptions are only used if there is an unexpected problem.- Specified by:
verifyin interfaceJwtVerifier<T>- Parameters:
token- textual token value - on the form a.b.c- Returns:
- a verified token, or null.
- Throws:
JwtException- on problem with token (i.e. known signature type not available)org.entur.jwt.jwk.JwksException- on problem with signing keys (i.e. authorization server is down)
-
verifyClaimTypes
protected void verifyClaimTypes(T token) throws JwtClaimException
- Throws:
JwtClaimException
-
verifyClaimValues
protected void verifyClaimValues(T token) throws JwtClaimException
- Throws:
JwtClaimException
-
getHealth
public org.entur.jwt.jwk.JwksHealth getHealth(boolean refresh)
- Specified by:
getHealthin interfaceorg.entur.jwt.jwk.JwksHealthProvider
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-