Web framework C++
2.0.0
Simple web framework on c++ designed to easily create web pages, etc
|
Concrete cookie strategy of AuthStrategy. More...
#include <cookie_auth.h>
Public Member Functions | |
CookieAuth (const char *secret, Middleware *cookie) | |
bool | checkHeadersToParse (Headers *headers) override |
std::string | getSerializedValue (Headers *headers) override |
void | serializeAndSetValueToResponse (std::string &value) override |
![]() | |
virtual | ~AuthStrategy ()=default |
Concrete cookie strategy of AuthStrategy.
This class is implementation of authentication clients by using cookies, in which some serialized data of user is stored to recognize him in following requests. It uses sha5256 algorithm to sign data
CookieAuth::CookieAuth | ( | const char * | secret, |
Middleware * | cookie | ||
) |
Create Cookie Auth middleware
secret | secret key used to sign data and prevent outside injections |
cookie | object of cookie middleware to parse cookies |
|
overridevirtual |
Check, if there are any cookies with data of authenticated user
headers | headers object |
Implements AuthStrategy.
|
overridevirtual |
Get user serialized data
headers | headers object |
Implements AuthStrategy.
|
overridevirtual |
Sign serialized data and set both to response cookies
value | serialized data of user |
Implements AuthStrategy.