Class JwtVerifyHandler

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

    public class JwtVerifyHandler
    extends Object
    implements com.networknt.handler.MiddlewareHandler, com.networknt.security.IJwtVerifyHandler
    This is a middleware handler that handles security verification for light-hybrid-4j framework. It verifies token signature and token expiration. Unlike the similar handler in light-rest-4j handles scope verification, this one doesn't as it is placed before rpc-router and exact service is unknown. The scope verification will be done in the rpc-router once the service is identified and schema is found. Both handlers share the same security.yml but just focus on different properties.
    Author:
    Steve Hu
    • Field Detail

      • jwtVerifier

        public static com.networknt.security.JwtVerifier jwtVerifier
    • Constructor Detail

      • JwtVerifyHandler

        public JwtVerifyHandler()
    • Method Detail

      • handleRequest

        public void handleRequest​(io.undertow.server.HttpServerExchange exchange)
                           throws Exception
        Specified by:
        handleRequest in interface io.undertow.server.HttpHandler
        Throws:
        Exception
      • 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
      • getJwtVerifier

        public com.networknt.security.JwtVerifier getJwtVerifier()
        Specified by:
        getJwtVerifier in interface com.networknt.security.IJwtVerifyHandler