WordClockESP/lib/framework/AuthenticationService.h

26 lines
690 B
C
Raw Normal View History

2019-05-18 18:35:27 +00:00
#ifndef AuthenticationService_H_
#define AuthenticationService_H_
#include <AsyncJson.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);
2019-05-18 18:35:27 +00:00
private:
SecurityManager* _securityManager;
AsyncCallbackJsonWebHandler _signInHandler;
2019-05-18 18:35:27 +00:00
// endpoint functions
void signIn(AsyncWebServerRequest* request, JsonVariant& json);
void verifyAuthorization(AsyncWebServerRequest* request);
2019-05-18 18:35:27 +00:00
};
#endif // end SecurityManager_h