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.

25 lines
690 B

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