449d3c91ce
* Add framework for built-time feature selection * Allow MQTT, NTP, OTA features to be disabled at build time * Allow Project screens to be disabled at build time * Allow security features to be disabled at build time * Switch to std::function for StatefulService function aliases for greater flexibility * Bump various UI lib versions * Update docs
31 lines
781 B
C++
31 lines
781 B
C++
#ifndef AuthenticationService_H_
|
|
#define AuthenticationService_H_
|
|
|
|
#include <Features.h>
|
|
#include <AsyncJson.h>
|
|
#include <ESPAsyncWebServer.h>
|
|
#include <SecurityManager.h>
|
|
|
|
#define VERIFY_AUTHORIZATION_PATH "/rest/verifyAuthorization"
|
|
#define SIGN_IN_PATH "/rest/signIn"
|
|
|
|
#define MAX_AUTHENTICATION_SIZE 256
|
|
|
|
#if FT_ENABLED(FT_SECURITY)
|
|
|
|
class AuthenticationService {
|
|
public:
|
|
AuthenticationService(AsyncWebServer* server, SecurityManager* securityManager);
|
|
|
|
private:
|
|
SecurityManager* _securityManager;
|
|
AsyncCallbackJsonWebHandler _signInHandler;
|
|
|
|
// endpoint functions
|
|
void signIn(AsyncWebServerRequest* request, JsonVariant& json);
|
|
void verifyAuthorization(AsyncWebServerRequest* request);
|
|
};
|
|
|
|
#endif // end FT_ENABLED(FT_SECURITY)
|
|
#endif // end SecurityManager_h
|