olp-cpp-sdk
1.22.0
|
Provides programmatic access to the HERE Account Authentication Service. More...
#include <AuthenticationClient.h>
Classes | |
struct | FederatedProperties |
The federated (Facebook, Google, ArcGIS) sign-in properties structure. More... | |
struct | RefreshProperties |
Used to generate a new access token and contains token values returned as a response to the user sign-in operation. More... | |
struct | SignInProperties |
General properties used to sign in with client credentials. More... | |
struct | SignUpProperties |
Used to create a new HERE account for the specified user with the email and password that are your login credentials. More... | |
struct | UserProperties |
The user sign-in properties struct. More... | |
Public Types | |
using | SignInClientResponse = Response< SignInResult > |
The client sign-in response type. | |
using | SignInClientCallback = Callback< SignInResult > |
The callback type of the client sign-in response. | |
using | SignInUserResponse = Response< SignInUserResult > |
The user sign-in response type. | |
using | SignInUserCallback = Callback< SignInUserResult > |
The callback type of the user sign-in response. | |
using | SignUpResponse = Response< SignUpResult > |
The client sign-up response type. | |
using | SignUpCallback = Callback< SignUpResult > |
The callback type of the user sign-up response. | |
using | SignOutUserResponse = Response< SignOutResult > |
The client sign-out response type. | |
using | SignOutUserCallback = Callback< SignOutResult > |
The callback type of the user sign-out response. | |
Public Member Functions | |
AuthenticationClient (AuthenticationSettings settings) | |
Creates the AuthenticationClient instance. More... | |
AuthenticationClient (const AuthenticationClient &)=delete | |
A copy constructor. | |
AuthenticationClient & | operator= (const AuthenticationClient &)=delete |
A copy assignment operator. | |
AuthenticationClient (AuthenticationClient &&) noexcept | |
A default move constructor. | |
AuthenticationClient & | operator= (AuthenticationClient &&) noexcept |
A move assignment operator. | |
client::CancellationToken | SignInClient (AuthenticationCredentials credentials, SignInProperties properties, SignInClientCallback callback) |
Signs in with your HERE Account client credentials and requests the client access token. More... | |
client::CancellationToken | SignInHereUser (const AuthenticationCredentials &credentials, const UserProperties &properties, const SignInUserCallback &callback) |
Signs in with the email and password that you used for registration via the sign-up API and requests your user access token. More... | |
client::CancellationToken | SignInFederated (AuthenticationCredentials credentials, std::string request_body, SignInUserCallback callback) |
Signs in with a custom request body. More... | |
client::CancellationToken | SignInFacebook (const AuthenticationCredentials &credentials, const FederatedProperties &properties, const SignInUserCallback &callback) |
Signs in with your valid Facebook token and requests your user access token. More... | |
client::CancellationToken | SignInArcGis (const AuthenticationCredentials &credentials, const FederatedProperties &properties, const SignInUserCallback &callback) |
Signs in with your valid ArcGIS token and requests your user access token. More... | |
client::CancellationToken | SignInApple (AppleSignInProperties properties, SignInUserCallback callback) |
Signs in with your valid Apple token and requests your user access token. More... | |
client::CancellationToken | SignInRefresh (const AuthenticationCredentials &credentials, const RefreshProperties &properties, const SignInUserCallback &callback) |
Signs in with the refresh token. More... | |
client::CancellationToken | SignUpHereUser (const AuthenticationCredentials &credentials, const SignUpProperties &properties, const SignUpCallback &callback) |
Signs up with your user properties and creates a new HERE Account to use your login credentials: email and password. More... | |
client::CancellationToken | AcceptTerms (const AuthenticationCredentials &credentials, const std::string &reacceptance_token, const SignInUserCallback &callback) |
Accepts the terms and conditions. More... | |
client::CancellationToken | SignOut (const AuthenticationCredentials &credentials, const std::string &user_access_token, const SignOutUserCallback &callback) |
Signs the user out. More... | |
client::CancellationToken | IntrospectApp (std::string access_token, IntrospectAppCallback callback) |
Retrieves the application associated with the client access token. More... | |
client::CancellationToken | Authorize (std::string access_token, AuthorizeRequest request, AuthorizeCallback callback) |
Retrieves policy decision for a given request context against the HERE Service. More... | |
client::CancellationToken | GetMyAccount (std::string access_token, UserAccountInfoCallback callback) |
Retrieves the account information associated with the user access token. More... | |
Provides programmatic access to the HERE Account Authentication Service.
The supported APIs mirror the REST APIs currently available for the HERE Account Authentication Service.
|
explicit |
Creates the AuthenticationClient
instance.
settings | The authentication settings that can be used to configure the AuthenticationClient instance. |
client::CancellationToken olp::authentication::AuthenticationClient::AcceptTerms | ( | const AuthenticationCredentials & | credentials, |
const std::string & | reacceptance_token, | ||
const SignInUserCallback & | callback | ||
) |
Accepts the terms and conditions.
Requires the "terms re-acceptance required" response represented by the following statuses:
The terms and conditions are explicitly accepted by providing the terms re-acceptance token back to this API.
credentials | The AuthenticationCredentials instance. |
reacceptance_token | The terms re-acceptance token from the HTTP 412 or HTTP 201 response: SignInUserResult::GetTermAcceptanceToken() . |
callback | The SignInUserCallback method that is called when the user sign-in request is completed. If successful, the returned HTTP status is 204. Otherwise, check the response error. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::Authorize | ( | std::string | access_token, |
AuthorizeRequest | request, | ||
AuthorizeCallback | callback | ||
) |
Retrieves policy decision for a given request context against the HERE Service.
Collects all permissions associated with the authenticated user or application, requested service ID, and requested contract ID.
access_token | A valid access token that is associated with the service. |
request | Еру сontext of the Authorize request. |
callback | TheAuthorizeCallback method that is called when the Authorize request is completed. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::GetMyAccount | ( | std::string | access_token, |
UserAccountInfoCallback | callback | ||
) |
Retrieves the account information associated with the user access token.
access_token | A valid access token that is associated with the user. |
callback | TheUserAccountInfoCallback method that is called when the user information request is completed. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::IntrospectApp | ( | std::string | access_token, |
IntrospectAppCallback | callback | ||
) |
Retrieves the application associated with the client access token.
The application does not need permissions to access this endpoint. It will allow any client access token to retrieve its own information.
access_token | A valid access token that is associated with the application. |
callback | TheIntrospectAppCallback method that is called when the client introspect request is completed. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::SignInApple | ( | AppleSignInProperties | properties, |
SignInUserCallback | callback | ||
) |
Signs in with your valid Apple token and requests your user access token.
properties | The AppleSignInProperties instance. |
callback | The SignInUserCallback method that is called when the user sign-in request is completed. If successful, the returned HTTP status is 200. If a new account is created as a part of the sign-in request, and terms must be accepted, the returned HTTP status is 201. Otherwise, check the response error. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::SignInArcGis | ( | const AuthenticationCredentials & | credentials, |
const FederatedProperties & | properties, | ||
const SignInUserCallback & | callback | ||
) |
Signs in with your valid ArcGIS token and requests your user access token.
If this is the first time that you use ArcGIS to sign in, a new HERE Account is automatically created and filled in with the data from your ArcGIS account, including your name and email.
credentials | The AuthenticationCredentials instance. |
properties | The FederatedProperties structure. |
callback | The SignInUserCallback method that is called when the user sign-in request is completed. If successful, the returned HTTP status is 200. If a new account is created as a part of the sign-in request and terms must be accepted, the returned HTTP status is 201. Otherwise, check the response error. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::SignInClient | ( | AuthenticationCredentials | credentials, |
SignInProperties | properties, | ||
SignInClientCallback | callback | ||
) |
Signs in with your HERE Account client credentials and requests the client access token.
The client access tokens cannot be refreshed. Instead, request a new client access token using your client credentials.
credentials | The AuthenticationCredentials instance. |
properties | The SignInProperties structure that has the scope and expiration time. |
callback | TheSignInClientCallback method that is called when the client sign-in request is completed. If successful, the returned HTTP status is 200. Otherwise, check the response error. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::SignInFacebook | ( | const AuthenticationCredentials & | credentials, |
const FederatedProperties & | properties, | ||
const SignInUserCallback & | callback | ||
) |
Signs in with your valid Facebook token and requests your user access token.
If this is the first time that you use Facebook to sign in, a new HERE Account is automatically created and filled in with the data from your Facebook account, including your name and email.
credentials | The AuthenticationCredentials instance. |
properties | The FederatedProperties structure. |
callback | The SignInUserCallback method that is called when the user sign-in request is completed. If successful, the returned HTTP status is 200. If a new account is created as a part of the sign-in request and terms must be accepted, the returned HTTP status is 201. Otherwise, check the response error. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::SignInFederated | ( | AuthenticationCredentials | credentials, |
std::string | request_body, | ||
SignInUserCallback | callback | ||
) |
Signs in with a custom request body.
This method provides the mechanism to authenticate with the HERE platform using a custom request body. You should use this method when the HERE platform authentication backend offers you individual parameters or endpoint.
credentials | The AuthenticationCredentials instance. |
request_body | The request body that will be passed to the OAuth endpoint. |
callback | The SignInUserCallback method that is called when the user sign-in request is completed. If successful, the returned HTTP status is 200. If a new account is created as a part of the sign-in request and terms must be accepted, the returned HTTP status is 201 for the first time and 412 for subsequent requests as long as you accept the terms. Otherwise, check the response error. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::SignInHereUser | ( | const AuthenticationCredentials & | credentials, |
const UserProperties & | properties, | ||
const SignInUserCallback & | callback | ||
) |
Signs in with the email and password that you used for registration via the sign-up API and requests your user access token.
The user access tokens can be refreshed using the SignInRefresh
method.
credentials | The AuthenticationCredentials instance. |
properties | The UserProperties structure. |
callback | The SignInUserCallback method that is called when the user sign-in request is completed. If successful, the returned HTTP status is 200. Otherwise, check the response error. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::SignInRefresh | ( | const AuthenticationCredentials & | credentials, |
const RefreshProperties & | properties, | ||
const SignInUserCallback & | callback | ||
) |
Signs in with the refresh token.
Exchanges the user access token and refresh token for a new user access token. The HERE user access token expires in 24 hours. Not to ask to specify the credentials again, a new access token can be requested using the refresh token. The refresh token is always matched to a particular access token and must be kept secure in the client. The access token can already be expired when used together with the refresh token. The refresh token expires after being used. There is a limit of 3 simultaneously active refresh tokens per user. After logging in 4 times, the first token-pair can no longer be refreshed.
credentials | The AuthenticationCredentials instance. |
properties | The RefreshProperties structure. |
callback | The SignInUserCallback method that is called when the user sign-in request is completed. If successful, the returned HTTP status is 200. Otherwise, check the response error. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::SignOut | ( | const AuthenticationCredentials & | credentials, |
const std::string & | user_access_token, | ||
const SignOutUserCallback & | callback | ||
) |
Signs the user out.
Calls the sign-out API and deletes any locally stored tokens. The access token that is used to sign out is immediately invalidated for the token refresh purposes.
credentials | The AuthenticationCredentials instance. |
user_access_token | The access token from the SignInUserResponse instance. |
callback | The SignOutUserCallback method that is called when the user sign-out request is completed. If successful, the returned HTTP status is 204. Otherwise, check the response error. |
CancellationToken
instance that can be used to cancel the request. client::CancellationToken olp::authentication::AuthenticationClient::SignUpHereUser | ( | const AuthenticationCredentials & | credentials, |
const SignUpProperties & | properties, | ||
const SignUpCallback & | callback | ||
) |
Signs up with your user properties and creates a new HERE Account to use your login credentials: email and password.
The HERE user is uniquely identified by the user ID that is consistent across the other HERE platform Services, regardless of the authentication method used.
credentials | The AuthenticationCredentials instance. |
properties | The SignUpProperties structure. |
callback | The SignUpCallback method that is called when the user sign-up request is completed. If successful, the returned HTTP status is 201. Otherwise, check the response error. |
CancellationToken
instance that can be used to cancel the request.