C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Public Types | Public Member Functions | List of all members
web::http::oauth2::experimental::oauth2_token Class Reference

OAuth 2.0 token and associated information. More...

#include <oauth2.h>

Public Types

enum  { undefined_expiration = -1 }
 Value for undefined expiration time in expires_in(). More...
 

Public Member Functions

 oauth2_token (utility::string_t access_token=utility::string_t())
 
bool is_valid_access_token () const
 Get access token validity state. If true, access token is a valid. More...
 
const utility::string_t & access_token () const
 Get access token. More...
 
void set_access_token (utility::string_t access_token)
 Set access token. More...
 
const utility::string_t & refresh_token () const
 Get refresh token. More...
 
void set_refresh_token (utility::string_t refresh_token)
 Set refresh token. More...
 
const utility::string_t & token_type () const
 Get token type. More...
 
void set_token_type (utility::string_t token_type)
 Set token type. More...
 
const utility::string_t & scope () const
 Get token scope. More...
 
void set_scope (utility::string_t scope)
 Set token scope. More...
 
int64_t expires_in () const
 Get the lifetime of the access token in seconds. For example, 3600 means the access token will expire in one hour from the time when access token response was generated by the authorization server. Value of undefined_expiration means expiration time is either unset or that it was not returned by the server with the access token. More...
 
void set_expires_in (int64_t expires_in)
 Set lifetime of access token (in seconds). More...
 

Detailed Description

OAuth 2.0 token and associated information.

Member Enumeration Documentation

anonymous enum

Value for undefined expiration time in expires_in().

Member Function Documentation

const utility::string_t& web::http::oauth2::experimental::oauth2_token::access_token ( ) const
inline

Get access token.

Returns
Access token string.
int64_t web::http::oauth2::experimental::oauth2_token::expires_in ( ) const
inline

Get the lifetime of the access token in seconds. For example, 3600 means the access token will expire in one hour from the time when access token response was generated by the authorization server. Value of undefined_expiration means expiration time is either unset or that it was not returned by the server with the access token.

Returns
Lifetime of the access token in seconds or undefined_expiration if not set.
bool web::http::oauth2::experimental::oauth2_token::is_valid_access_token ( ) const
inline

Get access token validity state. If true, access token is a valid.

Returns
Access token validity state.
const utility::string_t& web::http::oauth2::experimental::oauth2_token::refresh_token ( ) const
inline

Get refresh token.

Returns
Refresh token string.
const utility::string_t& web::http::oauth2::experimental::oauth2_token::scope ( ) const
inline

Get token scope.

Returns
Token scope string.
void web::http::oauth2::experimental::oauth2_token::set_access_token ( utility::string_t  access_token)
inline

Set access token.

Parameters
access_tokenAccess token string to set.
void web::http::oauth2::experimental::oauth2_token::set_expires_in ( int64_t  expires_in)
inline

Set lifetime of access token (in seconds).

Parameters
expires_inLifetime of access token in seconds.
void web::http::oauth2::experimental::oauth2_token::set_refresh_token ( utility::string_t  refresh_token)
inline

Set refresh token.

Parameters
refresh_tokenRefresh token string to set.
void web::http::oauth2::experimental::oauth2_token::set_scope ( utility::string_t  scope)
inline

Set token scope.

Parameters
scopeToken scope string to set.
void web::http::oauth2::experimental::oauth2_token::set_token_type ( utility::string_t  token_type)
inline

Set token type.

Parameters
token_typeToken type string to set.
const utility::string_t& web::http::oauth2::experimental::oauth2_token::token_type ( ) const
inline

Get token type.

Returns
Token type string.

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