10Duke Enterprise C++ Client
|
#include <OAuthStateService.h>
OAuth-state after successful authentication.
Public Member Functions | |
virtual bool | refresh ()=0 |
Refresh the state, i.e. | |
Public Member Functions inherited from tenduke::oauth::OAuthState | |
virtual const std::string & | getAccessToken () const =0 |
Returns the access token. | |
virtual const std::string & | getRefreshToken () const =0 |
Returns the refresh token. | |
virtual std::int64_t | getExpiresAt () const =0 |
Returns timestamp (as epoch seconds) when the current access token expires. | |
virtual const std::map< std::string, std::string > & | getAdditionalProperties () const =0 |
Returns all additional properties returned by the server. | |
virtual const std::string * | getAdditionalProperty (const std::string &name) const =0 |
Returns additional property returned by the server. | |
virtual bool | hasAdditionalProperty (const std::string &name) const =0 |
Checks if the state has additional property. | |
virtual void | removeAdditionalProperty (const std::string &propertyName)=0 |
Removes given additional property. | |
virtual bool | hasAccessToken () const =0 |
Returns true if the state contains an access token. | |
virtual bool | doesExpire () const =0 |
Returns true if the access token expires. | |
virtual bool | isRefreshable () const =0 |
Returns true if the state is refreshable (i.e. | |
virtual void | setAccessToken (const std::string &newAccessToken)=0 |
Set the access token. | |
virtual void | setExpiresAt (std::int64_t newExpiresAt)=0 |
Set the "expires at". | |
virtual void | setRefreshToken (const std::string &newRefreshToken)=0 |
Set the refresh token. | |
virtual void | refreshFrom (const OAuthState &state)=0 |
Refreshes the state from another state, This is called after refreshing the state with the service. | |
|
pure virtual |
Refresh the state, i.e.
requests new access token. The refresh is done synchronously.
true
if refreshed. Returns false
if nothing was done (because the state does not contain refresh token).tenduke::oauth::OAuthServerException | when the server responds with an error |
tenduke::oauth::OAuthException | when the server response is not what we expected, e.g.
|
tenduke::json::JSONParsingException | when response is not valid JSON |
tenduke::net::NetworkingException | (or subclasses of it) when networking error occurred, e.g.
|
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). |
Implemented in tenduke::oauth::OAuthStateServiceImpl.