Cognito User Manager is a user management solution that demonstrates building User flows in AWS Cognito using ASP.NET Core.
AWS Cognito is a user management and identity service offered by AWS as a part of its Cloud suite. It provides a single user identity and authentication service which can also be used to access all of its resources. The Users are placed inside isolated spaces called User Pools, which any registered third-party client can access via OAuth flows.
The solution demonstrates the following features / flows in AWS Cognito:
- New User SignUp
- Existing User SignIn
- Password Reset for a Signed In User
- Forgot Password flow for an unsigned user
- Fetch JWT Tokens (Id_Token, Access_Token, Refresh_Token) for a Signed In User
This solution can offer a solution to two problems:
- It demonstrates building Cognito login flows using .NET SDK
- It can work as a simple tool to create and manage users on a User Pool without having to go through the same process in AWS Console.
The solution requires the following things first to run:
- An active AWS Cognito User Pool
- An active Client created on the Cognito Pool which the solution uses to connect to the User Pool
- AccessKey and AccessSecretKey of a Programmatical User who has access to create Users
*You need to update these values inside appsettings.json
respectively
On the environment side, the solution requires a .NET Core (.NET 5) installation on the machine.
The solution is built using ASP.NET Core (.NET 5) with a pipeline to upgrade to .NET 6 (soon), so for now you'd need a .NET Core (.NET 5) installed on your machine.
- Clone the solution into your local repository
- Open the solution in Visual Studio and set CognitoUserManger.WebApp as the startup project
- Run the solution
or
- Clone the solution into your local repository
- Navigate to CognitoUserManager.WebApp directory and open a command prompt / Terminal
- Execute the command
dotnet run
To know more about this and to understand how this works in detail, I'd recommend you to check out the below articles where bits and pieces of this solution have been used:
- Implementing Cognito User Login and Signup in ASP.NET Core using AWS SDK
- Implementing Cognito Forgot Password and Update Profile in ASP.NET Core using AWS SDK
If you face any issues or would like to drop a suggestion,
The solution is completely open source and is licensed with MIT License.
Found this solution helpful and useful? You can do these to help this reach greater audience.
- Leave a star on this repository โญ
- Recommend this solution to your colleagues and dev community
- Join my Twitter family. I regularly post awesome content on dev over there.
- Join my Facebook community. I regularly post interesting content over there as well.
- You can also buy me a cup of great coffee โ!
For more detailed articles and how-to guides, visit https://referbruv.com