Class 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
      void close()  
      org.entur.jwt.jwk.JwksHealth getHealth​(boolean refresh)  
      T verify​(java.lang.String token)
      Verify token.
      protected void verifyClaimTypes​(T token)  
      protected void verifyClaimValues​(T token)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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: JwtVerifier
        Verify 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:
        verify in interface JwtVerifier<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)
      • getHealth

        public org.entur.jwt.jwk.JwksHealth getHealth​(boolean refresh)
        Specified by:
        getHealth in interface org.entur.jwt.jwk.JwksHealthProvider
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException