Class AuthHandlers
Defined in File auth_handlers.hpp
Class Documentation
-
class AuthHandlers
Handlers for authentication REST API endpoints.
Implements OAuth2-like authentication flow:
POST /auth/authorize - Authenticate with client credentials
POST /auth/token - Refresh access token
POST /auth/revoke - Revoke refresh token
Note
These endpoints are only available when authentication is enabled.
Public Functions
-
inline explicit AuthHandlers(HandlerContext &ctx)
Construct authentication handlers with shared context.
- Parameters:
ctx – The shared handler context
-
void handle_auth_authorize(const httplib::Request &req, httplib::Response &res)
Handle POST /auth/authorize - authenticate with client credentials.
-
void handle_auth_token(const httplib::Request &req, httplib::Response &res)
Handle POST /auth/token - refresh access token.
-
void handle_auth_revoke(const httplib::Request &req, httplib::Response &res)
Handle POST /auth/revoke - revoke refresh token.