WordClockESP/lib/framework/AuthenticationService.h

31 lines
781 B
C
Raw Permalink Normal View History

2019-05-18 18:35:27 +00:00
#ifndef AuthenticationService_H_
#define AuthenticationService_H_
#include <Features.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
#if FT_ENABLED(FT_SECURITY)
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 FT_ENABLED(FT_SECURITY)
#endif // end SecurityManager_h