Class JwtVerifyHandler

  • All Implemented Interfaces:
    com.networknt.handler.LightHttpHandler, com.networknt.handler.MiddlewareHandler, io.undertow.server.HttpHandler

    public class JwtVerifyHandler
    extends java.lang.Object
    implements com.networknt.handler.MiddlewareHandler
    This is a middleware handler that handles security verification for light-rest-4j framework. It verifies token signature and token expiration. And optional scope verification if it is enabled in security.yml config file.
    Author:
    Steve Hu
    • Field Summary

      • Fields inherited from interface com.networknt.handler.LightHttpHandler

        ERROR_NOT_DEFINED
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.undertow.server.HttpHandler getNext()  
      void handleRequest​(io.undertow.server.HttpServerExchange exchange)  
      boolean isEnabled()  
      protected boolean matchedScopes​(java.util.List<java.lang.String> jwtScopes, java.util.List<java.lang.String> specScopes)  
      void register()  
      com.networknt.handler.MiddlewareHandler setNext​(io.undertow.server.HttpHandler next)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.networknt.handler.LightHttpHandler

        setExchangeStatus, setExchangeStatus
    • Constructor Detail

      • JwtVerifyHandler

        public JwtVerifyHandler()
    • Method Detail

      • handleRequest

        public void handleRequest​(io.undertow.server.HttpServerExchange exchange)
                           throws java.lang.Exception
        Specified by:
        handleRequest in interface io.undertow.server.HttpHandler
        Throws:
        java.lang.Exception
      • matchedScopes

        protected boolean matchedScopes​(java.util.List<java.lang.String> jwtScopes,
                                        java.util.List<java.lang.String> specScopes)
      • getNext

        public io.undertow.server.HttpHandler getNext()
        Specified by:
        getNext in interface com.networknt.handler.MiddlewareHandler
      • setNext

        public com.networknt.handler.MiddlewareHandler setNext​(io.undertow.server.HttpHandler next)
        Specified by:
        setNext in interface com.networknt.handler.MiddlewareHandler
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface com.networknt.handler.MiddlewareHandler
      • register

        public void register()
        Specified by:
        register in interface com.networknt.handler.MiddlewareHandler