You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Amazon Cognito code examples for the SDK for C++
2
+
3
+
## Overview
4
+
5
+
Shows how to use the AWS SDK for C++ with Amazon Cognito to sign up users, set users up for multi-factor authentication (MFA), and sign in to
6
+
get access tokens.
7
+
8
+
*Amazon Cognito provides authentication, authorization, and user management for your web and mobile apps. Your users can sign in directly with a user name and password, or through a third party such as Facebook, Amazon, Google or Apple.*
9
+
10
+
## ⚠️ Important
11
+
12
+
* Running this code might result in charges to your AWS account.
13
+
* Running the tests might result in charges to your AWS account.
14
+
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
15
+
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
16
+
17
+
## Code examples
18
+
19
+
### Single actions
20
+
21
+
Code excerpts that show you how to call individual service functions.
22
+
23
+
*[Confirm a user](./getting_started_with_user_pools.cpp) (ConfirmSignUp)
24
+
*[Delete a user](./getting_started_with_user_pools.cpp) (DeleteUser)
25
+
*[Get a token to associate an MFA application with a user](./getting_started_with_user_pools.cpp) (AssociateSoftwareToken)
26
+
*[Get information about a user](./getting_started_with_user_pools.cpp) (AdminGetUser)
27
+
*[Resend a confirmation code](./getting_started_with_user_pools.cpp) (ResendConfirmationCode)
28
+
*[Respond to SRP authentication challenges](./getting_started_with_user_pools.cpp) (RespondToAuthChallenge)
29
+
*[Sign up a user](./getting_started_with_user_pools.cpp) (SignUp)
30
+
*[Start authentication with a tracked device](./getting_started_with_user_pools.cpp) (InitiateAuth)
31
+
*[Verify an MFA application with a user](./getting_started_with_user_pools.cpp) (VerifySoftwareToken)
32
+
33
+
### Scenarios
34
+
35
+
Code examples that show you how to accomplish a specific task by calling multiple functions within the same service.
36
+
37
+
*[Sign up a user with a user pool that requires MFA](./getting_started_with_user_pools.cpp) (ConfirmSignUp, DeleteUser,
Before using the code examples, first complete the installation and setup steps
44
+
for [Getting started](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/getting-started.html) in the AWS SDK for
45
+
C++ Developer Guide.
46
+
This section covers how to get and build the SDK, and how to build your own code by using the SDK with a
47
+
sample Hello World-style application.
48
+
49
+
Next, for information on code example structures and how to build and run the examples, see [Getting started with the AWS SDK for C++ code examples](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/getting-started-code-examples.html).
50
+
51
+
#### Running the `Sign up a user with a user pool that requires MFA` scenario.
52
+
53
+
The Amazon Cognito resources for `Sign up a user with a user pool that requires MFA` can be created by running the AWS CloudFormation
54
+
`setup.yaml` script in [resources/cdk/cognito_scenario_user_pool_with_mfa](../../../resources/cdk/cognito_scenario_user_pool_with_mfa/setup.yaml).
55
+
56
+
For instructions on how to run the script, see the [README](../../../resources/cdk/cognito_scenario_user_pool_with_mfa/README.md).
57
+
58
+
Optionally, build [Sign up a user with a user pool that requires MFA](./getting_started_with_user_pools.cpp) to use the
59
+
[qr-code-generator](https://github.com/nayuki/QR-Code-generator) library. This creates a QR code image for MFA authentication.
60
+
A [conanfile.txt](conanfile.txt) is included with the sample code. You can install the qr-code-generator library by using the [Conan C++ package manager](https://conan.io/).
61
+
62
+
To install the `qr-code-generator` library using Conan, run the following command from the build directory.
0 commit comments