Coder Social home page Coder Social logo

referbruv / cognitousermanager Goto Github PK

View Code? Open in Web Editor NEW
25.0 2.0 8.0 710 KB

Cognito User Manager is a user management solution that demonstrates building User flows in AWS Cognito using ASP.NET Core.

Home Page: https://referbruv.com

License: MIT License

C# 72.59% HTML 24.67% CSS 2.35% JavaScript 0.39%
asp-net-core aspnetcore dotnet dotnet5 aws cognito cognito-user-pool cognito-quickstart mvc clean-code

cognitousermanager's Introduction

CognitoUserManager - an ASP.NET Core MVC implementation for Cognito User Flows

.NET GitHub stars Twitter Follow

What is this solution about?

Cognito User Manager is a user management solution that demonstrates building User flows in AWS Cognito using ASP.NET Core.

What is AWS Cognito?

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.

What does the solution offer?

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:

  1. It demonstrates building Cognito login flows using .NET SDK
  2. 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.

What are the prerequisites?

The solution requires the following things first to run:

  1. An active AWS Cognito User Pool
  2. An active Client created on the Cognito Pool which the solution uses to connect to the User Pool
  3. 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.

How do I run this?

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.

  1. Clone the solution into your local repository
  2. Open the solution in Visual Studio and set CognitoUserManger.WebApp as the startup project
  3. Run the solution

or

  1. Clone the solution into your local repository
  2. Navigate to CognitoUserManager.WebApp directory and open a command prompt / Terminal
  3. Execute the command dotnet run

I want to know more

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:

Issues or Ideas?

If you face any issues or would like to drop a suggestion, raise an issue

License

The solution is completely open source and is licensed with MIT License.

Show your Support

Found this solution helpful and useful? You can do these to help this reach greater audience.

  1. Leave a star on this repository โญ
  2. Recommend this solution to your colleagues and dev community
  3. Join my Twitter family. I regularly post awesome content on dev over there.
  4. Join my Facebook community. I regularly post interesting content over there as well.
  5. You can also buy me a cup of great coffee โ˜•!

Buy Me A Coffee

For more detailed articles and how-to guides, visit https://referbruv.com

cognitousermanager's People

Contributors

referbruv avatar sriramkumarm1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cognitousermanager's Issues

Obtaining token when logging on via Cookie

Firstly, thanks for the code. It is really helping me get to grips with Cognito and helping me evolve my SAAS project.

Describe the bug
When creating a user, I can then log in and view the associated keys/tokens that were obtained via the login process.
If I then re-enter my app the cookies are used (good) but there no longer appears to be any tokens. As such if I try to log out it fails as there is no token to perform the operation.

General use questions and remarks

Thanks for the code and the article - very useful. You've earned a cup of coffee!!! I got some questions:

  1. If you/one is planning to run the back-end in an AWS Lambda, why use the SRP and not the Admin flow?
  2. In the section "Prerequisites for Accessing AWS Cognito Resources" you state "In case if we're not deploying our application inside an AWS environment we'd also require the credentials of a user who has all the required permissions for accessing the Cognito user pool.". If running in an AWS Lambda, would that piggy-back on the lambda's role to have the appropriate permissions? When running locally, why aren't these picked up from AWS credentials file?
  3. FindUsersByEmailAddress() doe snot work - I am getting "AmazonCognitoIdentityProviderException: The security token included in the request is invalid"

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.