49 bool HasAccessToken()
const;
52 bool HasRefreshToken()
const;
89 std::string GetAccessToken()
const;
93 static std::string MakeOAuthRequestURL(std::string_view authClientId);
96 std::string MakeAudioComAuthorizeURL(std::string_view
userId, std::string_view redirectUrl);
98 void Authorize(std::string_view email,
99 std::string_view password,
105 void Register(std::string_view email,
106 std::string_view password,
112 void AuthorisePassword(
115 std::function<
void(std::string_view)> completedHandler);
117 void AuthoriseRefreshToken(
119 AudiocomTrace, std::function<
void(std::string_view)> completedHandler,
122 void AuthoriseRefreshToken(
124 std::function<
void(std::string_view)> completedHandler,
bool silent);
127 const ServiceConfig& config, std::string_view authorizationCode,
bool useAudioComRedirectURI,
128 AudiocomTrace, std::function<
void(std::string_view)> completedHandler);
132 std::function<
void(std::string_view)> completedHandler,
bool silent);
134 void ParseTokenResponse(std::string_view response,
142 using Clock = std::chrono::steady_clock;
An object that sends messages to an open-ended list of subscribed callbacks.
Service responsible for OAuth authentication against the audio.com service.
std::function< void(std::string_view)> AuthSuccessCallback
std::chrono::steady_clock Clock
Clock::time_point mTokenExpirationTime
std::function< void(unsigned, std::string_view)> AuthFailureCallback
std::recursive_mutex mMutex
Configuration for the audio.com.
StringSetting refreshToken
OAuthService & GetOAuthService()
Returns the instance of the OAuthService.
Message that is sent when authorization state changes.
std::string_view accessToken
OAuth access token, valid for the current session or less.
bool authorised
Flag that indicates if user is authorised.
std::string_view errorMessage
Error message returned by the server in case of oauth error.