auth.h 526 B

12345678910111213141516171819202122
  1. #ifndef AUTH_H
  2. #define AUTH_H
  3. #include "httpd.h"
  4. #ifndef HTTP_AUTH_REALM
  5. #define HTTP_AUTH_REALM "Protected"
  6. #endif
  7. #define HTTPD_AUTH_SINGLE 0
  8. #define HTTPD_AUTH_CALLBACK 1
  9. #define AUTH_MAX_USER_LEN 32
  10. #define AUTH_MAX_PASS_LEN 32
  11. //Parameter given to authWhatever functions. This callback returns the usernames/passwords the device
  12. //has.
  13. typedef int (* AuthGetUserPw)(HttpdConnData *connData, int no, char *user, int userLen, char *pass, int passLen);
  14. int ICACHE_FLASH_ATTR authBasic(HttpdConnData *connData);
  15. #endif