Fork of the excellent esp8266-react - https://github.com/rjwats/esp8266-react
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
752 B

  1. #ifndef AuthenticationService_H_
  2. #define AuthenticationService_H_
  3. #include <AsyncJson.h>
  4. #include <AsyncJsonWebHandler.h>
  5. #include <ESPAsyncWebServer.h>
  6. #include <SecurityManager.h>
  7. #define VERIFY_AUTHORIZATION_PATH "/rest/verifyAuthorization"
  8. #define SIGN_IN_PATH "/rest/signIn"
  9. #define MAX_AUTHENTICATION_SIZE 256
  10. class AuthenticationService {
  11. public:
  12. AuthenticationService(AsyncWebServer* server, SecurityManager* securityManager);
  13. ~AuthenticationService();
  14. private:
  15. SecurityManager* _securityManager;
  16. AsyncJsonWebHandler _signInHandler;
  17. // endpoint functions
  18. void signIn(AsyncWebServerRequest* request, JsonDocument& jsonDocument);
  19. void verifyAuthorization(AsyncWebServerRequest* request);
  20. };
  21. #endif // end SecurityManager_h