olp-cpp-sdk 1.24.0
Loading...
Searching...
No Matches
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 <olp/core/porting/optional.h>
25#include "AuthenticationApi.h"
26
27namespace olp {
28namespace authentication {
45class AUTHENTICATION_API AuthenticationCredentials {
46 public:
61 static porting::optional<AuthenticationCredentials> ReadFromStream(
62 std::istream& stream);
63
85 static porting::optional<AuthenticationCredentials> ReadFromFile(
86 std::string filename = {});
88
96 AuthenticationCredentials(std::string key, std::string secret);
97
105 AuthenticationCredentials(std::string key, std::string secret,
106 std::string endpoint_url);
107
114 const std::string& GetKey() const;
115
122 const std::string& GetSecret() const;
123
130 const std::string& GetEndpointUrl() const;
131
132 private:
133 std::string key_;
134 std::string secret_;
135 std::string endpoint_url_;
136};
137
138} // namespace authentication
139} // 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
static porting::optional< AuthenticationCredentials > ReadFromStream(std::istream &stream)
Reads your access credentials from an input stream that is interpreted as a sequence of characters an...
AuthenticationCredentials(std::string key, std::string secret, std::string endpoint_url)
Creates the AuthenticationCredentials instance.
const std::string & GetSecret() const
Gets the access key secret from the AuthenticationCredentials instance.
const std::string & GetKey() const
Gets the access key ID from the AuthenticationCredentials instance.
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.
static porting::optional< AuthenticationCredentials > ReadFromFile(std::string filename={})
Parses the credentials.properties file downloaded from the HERE platform website and retrieves a valu...
Rules all the other namespaces.
Definition AppleSignInProperties.h:24