- All Implemented Interfaces:
- LightHttpHandler, MiddlewareHandler, io.undertow.server.HttpHandler
public class BasicAuthHandler
extends Object
implements MiddlewareHandler
This is a middleware handler that handles basic authentication in restful APIs. It is not used
in most situations as OAuth 2.0 is the standard. In certain cases for example, the server is
deployed to IoT devices, basic authentication can be used to replace OAuth 2.0 handlers.
There are multiple users that can be defined in basic.yml config file. Password can be stored in plain or
encrypted format in basic.yml. In case of password encryption, please remember to add corresponding
com.networknt.utility.Decryptor in service.yml. And access is logged into audit.log if audit middleware is used.
- Author:
- Steve Hu