olp-cpp-sdk  1.22.0
AuthenticationCredentials.h
1 /*
2  * Copyright (C) 2019-2021 HERE Europe B.V.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * SPDX-License-Identifier: Apache-2.0
17  * License-Filename: LICENSE
18  */
19 
20 #pragma once
21 
22 #include <string>
23 
24 #include <boost/optional/optional.hpp>
25 #include "AuthenticationApi.h"
26 
27 namespace olp {
28 namespace authentication {
45 class AUTHENTICATION_API AuthenticationCredentials {
46  public:
61  static boost::optional<AuthenticationCredentials> ReadFromStream(
62  std::istream& stream);
63 
84  static boost::optional<AuthenticationCredentials> ReadFromFile(
85  std::string filename = {});
86  AuthenticationCredentials() = delete;
87 
95  AuthenticationCredentials(std::string key, std::string secret);
96 
104  AuthenticationCredentials(std::string key, std::string secret,
105  std::string endpoint_url);
106 
113  const std::string& GetKey() const;
114 
121  const std::string& GetSecret() const;
122 
129  const std::string& GetEndpointUrl() const;
130 
131  private:
132  std::string key_;
133  std::string secret_;
134  std::string endpoint_url_;
135 };
136 
137 } // namespace authentication
138 } // namespace olp
The access key ID and access key secret that you got from the HERE Account as a part of the onboardin...
Definition: AuthenticationCredentials.h:45
AuthenticationCredentials(std::string key, std::string secret, std::string endpoint_url)
Creates the AuthenticationCredentials instance.
static boost::optional< AuthenticationCredentials > ReadFromFile(std::string filename={})
Parses the credentials.properties file downloaded from the HERE platform website and retrieves a valu...
const std::string & GetEndpointUrl() const
Gets the token endpoint URL from the AuthenticationCredentials instance.
AuthenticationCredentials(std::string key, std::string secret)
Creates the AuthenticationCredentials instance with your access key ID and access key secret.
const std::string & GetKey() const
Gets the access key ID from the AuthenticationCredentials instance.
const std::string & GetSecret() const
Gets the access key secret from the AuthenticationCredentials instance.
static boost::optional< AuthenticationCredentials > ReadFromStream(std::istream &stream)
Reads your access credentials from an input stream that is interpreted as a sequence of characters an...
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24