Virgil Security C++ SDK
Public Member Functions | List of all members
virgil::sdk::jwt::providers::CallbackJwtProvider Class Reference

Implementation of AccessTokenProviderInterface which provides AccessToken using callback. More...

#include <CallbackJwtProvider.h>

Inheritance diagram for virgil::sdk::jwt::providers::CallbackJwtProvider:
virgil::sdk::jwt::interfaces::AccessTokenProviderInterface

Public Member Functions

 CallbackJwtProvider (std::function< std::future< std::string >(const TokenContext &)> getTokenCallback)
 Constructor. More...
 
std::future< std::shared_ptr< interfaces::AccessTokenInterface > > getToken (const TokenContext &tokenContext)
 Provides access token using callback. More...
 
const std::function< std::future< std::string >const TokenContext &)> & getTokenCallback () const
 Getter. More...
 
- Public Member Functions inherited from virgil::sdk::jwt::interfaces::AccessTokenProviderInterface
virtual ~AccessTokenProviderInterface ()=default
 Virtual destructor.
 

Detailed Description

Implementation of AccessTokenProviderInterface which provides AccessToken using callback.

Constructor & Destructor Documentation

virgil::sdk::jwt::providers::CallbackJwtProvider::CallbackJwtProvider ( std::function< std::future< std::string >(const TokenContext &)>  getTokenCallback)

Constructor.

Parameters
getTokenCallbackstd::function, which takes a TokenContext returns std::future with Jwt std::string

Member Function Documentation

std::future<std::shared_ptr<interfaces::AccessTokenInterface> > virgil::sdk::jwt::providers::CallbackJwtProvider::getToken ( const TokenContext tokenContext)
virtual

Provides access token using callback.

Parameters
tokenContextTokenContext provides context explaining why token is needed
Returns
std::future with std::shared_ptr to Jwt

Implements virgil::sdk::jwt::interfaces::AccessTokenProviderInterface.

const std::function<std::future<std::string>const TokenContext&)>& virgil::sdk::jwt::providers::CallbackJwtProvider::getTokenCallback ( ) const

Getter.

Returns
callback provider uses to obtain token

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