WordClockESP/lib/framework/AuthenticationService.h

28 lines
752 B
C
Raw Normal View History

2019-05-18 18:35:27 +00:00
#ifndef AuthenticationService_H_
#define AuthenticationService_H_
#include <AsyncJson.h>
#include <AsyncJsonWebHandler.h>
#include <ESPAsyncWebServer.h>
#include <SecurityManager.h>
2019-05-18 18:35:27 +00:00
#define VERIFY_AUTHORIZATION_PATH "/rest/verifyAuthorization"
#define SIGN_IN_PATH "/rest/signIn"
#define MAX_AUTHENTICATION_SIZE 256
class AuthenticationService {
public:
AuthenticationService(AsyncWebServer* server, SecurityManager* securityManager);
~AuthenticationService();
2019-05-18 18:35:27 +00:00
private:
SecurityManager* _securityManager;
AsyncJsonWebHandler _signInHandler;
2019-05-18 18:35:27 +00:00
// endpoint functions
void signIn(AsyncWebServerRequest* request, JsonDocument& jsonDocument);
void verifyAuthorization(AsyncWebServerRequest* request);
2019-05-18 18:35:27 +00:00
};
#endif // end SecurityManager_h