PKCE-implementation of tenduke::oauth::OAuthRequest.
|
| virtual std::map< std::string, std::string > | buildTokenRequestParameters (const std::string &code) const |
| | Builds parameters for the token request.
|
| virtual std::map< std::string, std::string > | buildAuthorizationRequestParameters () const |
| | Builds parameters for the authorization request.
|
| virtual void | createCodeChallenge (std::map< std::string, std::string > ¶meters) const |
| | Creates PKCE code challenge and adds it to the provided parameters.
|
| virtual std::unique_ptr< tenduke::oauth::OAuthState > | handleSuccessfulCallback (const std::multimap< std::string, std::string > &queryParameters) const |
| | Handles successful callback to redirect-uri from authorization request, performing the next steps to complete the authorization.
|
| virtual bool | isPKCERequest () const |
| | Checks if this is PKCE-request.
|
| virtual std::unique_ptr< tenduke::oauth::OAuthTokenRequest > | createTokenRequest (const std::string &code) const |
| | Creates the token request.
|
| | BaseOAuthRequest (const std::string &scopes, const std::map< std::string, std::string > &additionalParameters, const std::shared_ptr< const ::tenduke::oauth::OAuthConfiguration > &config, const std::shared_ptr< const ::tenduke::http::HTTPClient > &http, const std::shared_ptr< const ::tenduke::json::JSONParser > &parseJson, const std::shared_ptr<::tenduke::time::Clock > &clock) |
| | Constructs new instance.
|
| virtual std::map< std::string, std::string > | buildTokenRequestParameters () const |
| | Builds base parameters for the token request.
|
| virtual std::unique_ptr<::tenduke::oauth::OAuthTokenRequest > | createTokenRequest () const |
| | Creates the token request.
|
| virtual std::unique_ptr<::tenduke::oauth::OAuthState > | handleTokenResponse (std::unique_ptr<::tenduke::oauth::OAuthTokenResponse > response) const |
| | Handles token response.
|
| std::unique_ptr<::OAuthState > tenduke::oauth::pkce::OAuthPKCERequest::handleCallback |
( |
const std::string & | redirectURI | ) |
const |
|
overridevirtual |
Handles callback: performs consequent actions to authorize.
In the flow, the OAuth-server signals success or error by navigating (using HTTP-redirect) to configured redirect-URI. You must listen the browser events to detect, when the redirect-URI is navigated to. Once you detect navigation to the redirect-URI, call this method with the complete redirect-URI.
The call is synchronous.
- Parameters
-
- Returns
- the OAuth-state
- Exceptions
-
| std::nested_exception | when the there is some nested cause |
| tenduke::http::HTTPException | (or subclasses of it) when the server responds with HTTP error status code which does not indicate OAuth-error, e.g. 500 (internal server error) or 404 (not found = wrong endpoint configured) |
| tenduke::json::JSONParsingException | when server response is not valid JSON |
| tenduke::oauth::OAuthException | when the server response is not what we expected, e.g.
- problems with the redirect-URI (missing or invalid "state", missing "code")
- The token response does not contain access_token
- The token response payload is not JSON-object
|
| tenduke::oauth::OAuthServerError | when the server responds with an error |
| tenduke::net::NetworkingException | (or subclasses of it) when networking error occurred, e.g.
|
| tenduke::net::URLException | if problem parsing the redirectURI (should not happen, though) |
| tenduke::net::MalformedURLException | if the redirectURI is invalid |
Implements tenduke::oauth::OAuthBrowserAuthorizationRequest.