Fledge
An open source edge computing platform for industrial users
OCS Class Reference

The OCS class. More...

#include <ocs.h>

Public Member Functions

 OCS (const std::string &authorizationUrl)
 
std::string OCSRetrieveAuthToken (const string &clientId, const string &clientSecret, bool logMessage=true)
 Calls the ADH API to retrieve the authentication token. More...
 
int retrieveToken (const string &clientId, const string &clientSecret, bool logMessage=true)
 Calls the OCS/ADH API to retrieve the authentication token related to the the clientId and clientSecret. More...
 
void extractToken (const string &response)
 Extracts the OCS token from the JSON returned by the OCS API. More...
 

Detailed Description

The OCS class.

Member Function Documentation

◆ extractToken()

void OCS::extractToken ( const string &  response)

Extracts the OCS token from the JSON returned by the OCS API.

Parameters
responseJSON message generated by the OCS API containing the OCS token

◆ OCSRetrieveAuthToken()

string OCS::OCSRetrieveAuthToken ( const string &  clientId,
const string &  clientSecret,
bool  logMessage = true 
)

Calls the ADH API to retrieve the authentication token.

Parameters
logMessageIf true, log error messages (default: true)
Returns
token Authorization token

◆ retrieveToken()

int OCS::retrieveToken ( const string &  clientId,
const string &  clientSecret,
bool  logMessage = true 
)

Calls the OCS/ADH API to retrieve the authentication token related to the the clientId and clientSecret.

Parameters
clientIdClient Id code assigned by OCS/ADH using its GUI to the specific connection
clientSecretClient Secret code assigned by OCS/ADH using its GUI to the specific connection
logMessageIf true, log error messages (default: true)
Returns
HTTP Code

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