18 #define TIMEOUT_CONNECT 10
19 #define TIMEOUT_REQUEST 10
20 #define RETRY_SLEEP_TIME 1
22 #define URL_RETRIEVE_TOKEN "/identity/connect/token"
24 #define PAYLOAD_RETRIEVE_TOKEN "grant_type=client_credentials&client_id=CLIENT_ID_PLACEHOLDER&client_secret=CLIENT_SECRET_ID_PLACEHOLDER"
32 OCS(
const std::string &authorizationUrl);
37 std::string OCSRetrieveAuthToken(
const string& clientId,
const string& clientSecret,
bool logMessage =
true);
38 int retrieveToken(
const string& clientId,
const string& clientSecret,
bool logMessage =
true);
39 void extractToken(
const string& response);
42 std::string m_authUrl;
43 unsigned int m_expiresIn;
44 std::chrono::steady_clock::time_point m_nextAuthentication;