olp-cpp-sdk  1.22.0
Public Member Functions | List of all members
olp::authentication::internal::TokenProviderImpl Class Reference

#include <TokenProvider.h>

Public Member Functions

 TokenProviderImpl (Settings settings, std::chrono::seconds minimum_validity)
 Creates the TokenProviderImpl instance. More...
 
client::OauthTokenResponse operator() (client::CancellationContext &context) const
 
ErrorResponse GetErrorResponse () const
 Allows the olp::client::ApiError object associated with the last request to be accessed if the token request is unsuccessful. More...
 
int GetHttpStatusCode () const
 Gets the HTTP status code of the last request. More...
 
TokenResponse GetResponse (client::CancellationContext &context) const
 
bool IsTokenResponseOK () const
 

Detailed Description

An implementation of TokenProvider.

Note
This is a private implementation class for internal use only, and not bound to any API stability promises. Please do not use directly.

Constructor & Destructor Documentation

◆ TokenProviderImpl()

olp::authentication::internal::TokenProviderImpl::TokenProviderImpl ( Settings  settings,
std::chrono::seconds  minimum_validity 
)

Creates the TokenProviderImpl instance.

Parameters
settingsThe Settings object that is used to customize the TokenEndpoint instance.
minimum_validitySets the minimum validity period of the token in seconds.

Member Function Documentation

◆ GetErrorResponse()

ErrorResponse olp::authentication::internal::TokenProviderImpl::GetErrorResponse ( ) const

Allows the olp::client::ApiError object associated with the last request to be accessed if the token request is unsuccessful.

Returns
An error if the last token request failed.

◆ GetHttpStatusCode()

int olp::authentication::internal::TokenProviderImpl::GetHttpStatusCode ( ) const

Gets the HTTP status code of the last request.

Returns
The HTTP code of the last token request if it was successful. Otherwise, returns the HTTP 503 Service Unavailable server error.

◆ GetResponse()

TokenResponse olp::authentication::internal::TokenProviderImpl::GetResponse ( client::CancellationContext context) const

◆ IsTokenResponseOK()

bool olp::authentication::internal::TokenProviderImpl::IsTokenResponseOK ( ) const

◆ operator()()

client::OauthTokenResponse olp::authentication::internal::TokenProviderImpl::operator() ( client::CancellationContext context) const


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