olp-cpp-sdk  1.19.0
Public Member Functions | Static Public Member Functions | List of all members
olp::authentication::AuthenticationCredentials Class Reference

The access key ID and access key secret that you got from the HERE Account as a part of the onboarding or support process on the developer portal. More...

#include <AuthenticationCredentials.h>

Public Member Functions

 AuthenticationCredentials (std::string key, std::string secret)
 Creates the AuthenticationCredentials instance with your access key ID and access key secret. More...
 
 AuthenticationCredentials (std::string key, std::string secret, std::string endpoint_url)
 Creates the AuthenticationCredentials instance. More...
 
const std::string & GetKey () const
 Gets the access key ID from the AuthenticationCredentials instance. More...
 
const std::string & GetSecret () const
 Gets the access key secret from the AuthenticationCredentials instance. More...
 
const std::string & GetEndpointUrl () const
 Gets the token endpoint URL from the AuthenticationCredentials instance. More...
 

Static Public Member Functions

static boost::optional< AuthenticationCredentialsReadFromStream (std::istream &stream)
 Reads your access credentials from an input stream that is interpreted as a sequence of characters and retrieves a value with your credentials. More...
 
static boost::optional< AuthenticationCredentialsReadFromFile (std::string filename={})
 Parses the credentials.properties file downloaded from the HERE platform website and retrieves a value with your credentials. More...
 

Detailed Description

The access key ID and access key secret that you got from the HERE Account as a part of the onboarding or support process on the developer portal.

Your credentials can be read in the following 2 ways:

For instructions on how to get the access keys, see the Get Credentials section in the Terms and Permissions User Guide.

Constructor & Destructor Documentation

◆ AuthenticationCredentials() [1/2]

olp::authentication::AuthenticationCredentials::AuthenticationCredentials ( std::string  key,
std::string  secret 
)

Creates the AuthenticationCredentials instance with your access key ID and access key secret.

Parameters
keyYour access key ID.
secretYour access key secret.

◆ AuthenticationCredentials() [2/2]

olp::authentication::AuthenticationCredentials::AuthenticationCredentials ( std::string  key,
std::string  secret,
std::string  endpoint_url 
)

Creates the AuthenticationCredentials instance.

Parameters
keyThe access key ID.
secretThe access key secret.
endpoint_urlThe token endpoint URL.

Member Function Documentation

◆ GetEndpointUrl()

const std::string& olp::authentication::AuthenticationCredentials::GetEndpointUrl ( ) const

Gets the token endpoint URL from the AuthenticationCredentials instance.

Returns
A const reference to the access token endpoint URL member.

◆ GetKey()

const std::string& olp::authentication::AuthenticationCredentials::GetKey ( ) const

Gets the access key ID from the AuthenticationCredentials instance.

Returns
The const reference to the access key ID member.

◆ GetSecret()

const std::string& olp::authentication::AuthenticationCredentials::GetSecret ( ) const

Gets the access key secret from the AuthenticationCredentials instance.

Returns
The const reference to the access key secret member.

◆ ReadFromFile()

static boost::optional<AuthenticationCredentials> olp::authentication::AuthenticationCredentials::ReadFromFile ( std::string  filename = {})
static

Parses the credentials.properties file downloaded from the HERE platform website and retrieves a value with your credentials.

The file must contain the following lines:

  • here.access.key.id – your access key ID
  • here.access.key.secret – your access key secret

For instructions on how to get the credentials.properties file, see the Get Credentials section in the Terms and Permissions User Guide.

Parameters
[in]filenameThe path to the file that contains the credentials. An empty path is replaced with the following default path: $HOME/.here/credentials.properties
Returns
The optional value with your credentials if the credentials were read successfully, or no value in case of failure.

◆ ReadFromStream()

static boost::optional<AuthenticationCredentials> olp::authentication::AuthenticationCredentials::ReadFromStream ( std::istream &  stream)
static

Reads your access credentials from an input stream that is interpreted as a sequence of characters and retrieves a value with your credentials.

The stream must contain the following sequences of characters:

  • here.access.key.id – your access key ID
  • here.access.key.secret – your access key secret
Parameters
[in]streamThe stream from which the credentials are read.
Returns
An optional value with your credentials if the credentials were read successfully, or no value in case of failure.

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