10Duke Scale C++ Client
Loading...
Searching...
No Matches
RedirectUriHandler.h
1#ifndef TENDUKE_OIDC_OSBROWSER_REDIRECTURIHANDLER_H
2#define TENDUKE_OIDC_OSBROWSER_REDIRECTURIHANDLER_H
3
4#include "http/server/HTTPRequestHandler.h"
5
6#include <future>
7#include <mutex>
8#include <string>
9
10namespace tenduke { namespace oidc { namespace osbrowser {
11
16{
17public:
22 explicit RedirectUriHandler(std::string responseMessage)
23 : responseMessage(std::move(responseMessage)), handled(false)
24 {}
25
29 void abort();
30
35 std::future<std::string> getResult();
36
37 // tenduke::http::server::HTTPRequestHandler interface
38public:
39 void handle(
42 ) override;
43
44
45private:
46 const std::string responseMessage;
47 bool handled;
48 std::promise<std::string> result;
49 std::mutex lockResult;
50};
51
52}}}
53
54#endif //TENDUKE_OIDC_OSBROWSER_REDIRECTURIHANDLER_H
Service interface for handling a HTTP request.
Definition HTTPRequestHandler.h:12
A HTTP-request parsed by HTTP server.
Definition HTTPRequest.h:17
HTTP-response to be returned by a HTTP server.
Definition HTTPResponse.h:15
A HTTPRequestHandler, which listens to OAuth2 server redirect URI and signals of the completion of th...
Definition RedirectUriHandler.h:16
std::future< std::string > getResult()
Returns the result.
Definition RedirectUriHandler.cpp:53
RedirectUriHandler(std::string responseMessage)
Constructs new instance.
Definition RedirectUriHandler.h:22
void abort()
Aborts.
Definition RedirectUriHandler.cpp:38
void handle(http::server::HTTPRequest request, http::server::HTTPResponse response) override
Handles the request.
Definition RedirectUriHandler.cpp:12
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7