Package com.networknt.deref
Class DerefMiddlewareHandler
- java.lang.Object
-
- com.networknt.deref.DerefMiddlewareHandler
-
- All Implemented Interfaces:
LightHttpHandler,MiddlewareHandler,io.undertow.server.HttpHandler
public class DerefMiddlewareHandler extends Object implements MiddlewareHandler
This is the middleware handler that is responsible for sending the by reference token to OAuth 2.0 provider to exchange to a JWT in order to satisfy the light framework requirement. This is usually used on the BFF which is a static access point for the external clients. For some organizations, they would not send the JWT token to the Internet but only the by reference token to the outside. However, internally we need JWT token to access APIs or services. This handler can work with one OAuth 2.0 provider or two OAuth 2.0 providers (External OAuth 2.0 and Internal OAuth 2.0)- Author:
- Steve Hu
-
-
Field Summary
Fields Modifier and Type Field Description static DerefConfigconfig-
Fields inherited from interface com.networknt.handler.LightHttpHandler
AUDIT_CONFIG_NAME, AUDIT_ON_ERROR, AUDIT_STACK_TRACE, auditConfig, auditOnError, auditStackTrace, ERROR_NOT_DEFINED
-
-
Constructor Summary
Constructors Constructor Description DerefMiddlewareHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.undertow.server.HttpHandlergetNext()voidhandleRequest(io.undertow.server.HttpServerExchange exchange)booleanisEnabled()voidregister()MiddlewareHandlersetNext(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, setExchangeStatus
-
Methods inherited from interface com.networknt.handler.MiddlewareHandler
reload
-
-
-
-
Field Detail
-
config
public static DerefConfig config
-
-
Method Detail
-
handleRequest
public void handleRequest(io.undertow.server.HttpServerExchange exchange) throws Exception- Specified by:
handleRequestin interfaceio.undertow.server.HttpHandler- Throws:
Exception
-
getNext
public io.undertow.server.HttpHandler getNext()
- Specified by:
getNextin interfaceMiddlewareHandler
-
setNext
public MiddlewareHandler setNext(io.undertow.server.HttpHandler next)
- Specified by:
setNextin interfaceMiddlewareHandler
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceMiddlewareHandler
-
register
public void register()
- Specified by:
registerin interfaceMiddlewareHandler
-
-