|
10Duke Enterprise C++ SDK
|
#include <OAuthDeviceFlowAuthorizationRequest.h>
Authorization request for OAuth Device Flow.
Instances implement all the actual logic for the flow.
Public Member Functions | |
| virtual tenduke::oauth::device::DeviceAuthorizationResponse | authorizationRequest ()=0 |
| Performs Device Authorization Request. | |
| virtual std::unique_ptr< tenduke::oauth::OAuthState > | accessTokenRequest ()=0 |
| Performs Device Access Token Request. | |
| virtual void | cancel ()=0 |
| Marks the request canceled. | |
|
pure virtual |
Performs Device Access Token Request.
See: https://datatracker.ietf.org/doc/html/rfc8628#section-3.4
| tenduke::Canceled | if the request was canceled by caller |
| tenduke::TimedOut | if the request has timed out (either in client or by backend) |
| tenduke::http::HTTPException | (or subclasses) in case of HTTPExceptions (e.g. HTTP 500) |
| tenduke::json::JSONException | (or subclasses) in case response is not valid JSON (should not happen) |
| tenduke::net::NetworkingException | (or subclasses) e.g. no network, invalid hostname, timeouts |
| tenduke::oauth::OAuthServerError | if OAuth server returned an error |
| tenduke::oauth::OAuthException | if some other OAuth error occurred |
|
pure virtual |
Performs Device Authorization Request.
See: https://datatracker.ietf.org/doc/html/rfc8628#section-3.1
| tenduke::Canceled | if the request was canceled by caller |
| tenduke::TimedOut | if the request has timed out (either in client or by backend) |
| tenduke::http::HTTPException | (or subclasses) in case of HTTPExceptions (e.g. HTTP 500) |
| tenduke::net::NetworkingException | (or subclasses) e.g. no network, invalid hostname, timeouts |
| tenduke::oauth::OAuthServerError | if OAuth server returned an error |
| tenduke::oauth::OAuthException | if some other OAuth error occurred, e.g. error invalid_device_authorization_response if the response is not a JSON object, or does not have device_code, user_code, verification_uri or a positive expires_in, or if verification_uri or verification_uri_complete is not an absolute https URL (http is accepted for loopback hosts only). expires_in is limited to one hour and interval to one minute. |
|
pure virtual |
Marks the request canceled.
Can be called from another thread.
authorizationRequest() and accessTokenRequest() then throw tenduke::Canceled. A wait between polls ends immediately. An HTTP request in progress is not interrupted, but its result is discarded.