10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::oauth::OAuthState Class Referenceabstract

#include <OAuthState.h>

Detailed Description

OAuth session state.

Inheritance diagram for tenduke::oauth::OAuthState:
tenduke::oauth::OAuthStateImpl tenduke::oauth::OAuthStateService tenduke::oidc::OIDCState tenduke::oauth::OAuthStateServiceImpl

Public Member Functions

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.
 

Member Function Documentation

◆ doesExpire()

virtual bool tenduke::oauth::OAuthState::doesExpire ( ) const
pure virtual

Returns true if the access token expires.

Returns false if the access token does not expire.

Returns
-

Implemented in tenduke::oauth::OAuthStateImpl, and tenduke::oauth::OAuthStateServiceImpl.

◆ getAccessToken()

virtual const std::string & tenduke::oauth::OAuthState::getAccessToken ( ) const
pure virtual

Returns the access token.

Implemented in tenduke::oauth::OAuthStateImpl, and tenduke::oauth::OAuthStateServiceImpl.

◆ getAdditionalProperties()

virtual const std::map< std::string, std::string > & tenduke::oauth::OAuthState::getAdditionalProperties ( ) const
pure virtual

Returns all additional properties returned by the server.

Returns
-

Implemented in tenduke::oauth::OAuthStateImpl.

◆ getAdditionalProperty()

virtual const std::string * tenduke::oauth::OAuthState::getAdditionalProperty ( const std::string &  name) const
pure virtual

Returns additional property returned by the server.

Parameters
nameproperty name
Returns
property value or nullptr if no such property

Implemented in tenduke::oauth::OAuthStateImpl, and tenduke::oauth::OAuthStateServiceImpl.

◆ getExpiresAt()

virtual std::int64_t tenduke::oauth::OAuthState::getExpiresAt ( ) const
pure virtual

Returns timestamp (as epoch seconds) when the current access token expires.

Returns
expiration of current accesstime in epoch seconds. Returns tenduke::oauth::TOKEN_DOES_NOT_EXPIRE if server did not return "expires_at".

Implemented in tenduke::oauth::OAuthStateImpl, and tenduke::oauth::OAuthStateServiceImpl.

◆ getRefreshToken()

virtual const std::string & tenduke::oauth::OAuthState::getRefreshToken ( ) const
pure virtual

Returns the refresh token.

Returns
the refresh-token. Returns empty string if no refresh token.

Implemented in tenduke::oauth::OAuthStateImpl, and tenduke::oauth::OAuthStateServiceImpl.

◆ hasAccessToken()

virtual bool tenduke::oauth::OAuthState::hasAccessToken ( ) const
pure virtual

Returns true if the state contains an access token.

(Uninitialized states do not contain access token).

Returns
-

Implemented in tenduke::oauth::OAuthStateImpl, and tenduke::oauth::OAuthStateServiceImpl.

◆ hasAdditionalProperty()

virtual bool tenduke::oauth::OAuthState::hasAdditionalProperty ( const std::string &  name) const
pure virtual

Checks if the state has additional property.

Parameters
name-
Returns
-

Implemented in tenduke::oauth::OAuthStateImpl.

◆ isRefreshable()

virtual bool tenduke::oauth::OAuthState::isRefreshable ( ) const
pure virtual

Returns true if the state is refreshable (i.e.

it contains refresh-token).

Returns
-

Implemented in tenduke::oauth::OAuthStateImpl, and tenduke::oauth::OAuthStateServiceImpl.

◆ refreshFrom()

virtual void tenduke::oauth::OAuthState::refreshFrom ( const OAuthState state)
pure virtual

Refreshes the state from another state, This is called after refreshing the state with the service.

Parameters
state-

Implemented in tenduke::oauth::OAuthStateImpl.

◆ removeAdditionalProperty()

virtual void tenduke::oauth::OAuthState::removeAdditionalProperty ( const std::string &  propertyName)
pure virtual

Removes given additional property.

Parameters
propertyName-

Implemented in tenduke::oauth::OAuthStateImpl.

◆ setAccessToken()

virtual void tenduke::oauth::OAuthState::setAccessToken ( const std::string &  newAccessToken)
pure virtual

Set the access token.

Parameters
newAccessToken-

Implemented in tenduke::oauth::OAuthStateImpl.

◆ setExpiresAt()

virtual void tenduke::oauth::OAuthState::setExpiresAt ( std::int64_t  newExpiresAt)
pure virtual

Set the "expires at".

Parameters
newExpiresAt-

Implemented in tenduke::oauth::OAuthStateImpl.

◆ setRefreshToken()

virtual void tenduke::oauth::OAuthState::setRefreshToken ( const std::string &  newRefreshToken)
pure virtual

Set the refresh token.

Parameters
newRefreshToken-

Implemented in tenduke::oauth::OAuthStateImpl.


The documentation for this class was generated from the following file: