Integrate the Volentix Django REST framework backend with AWS Cognito

venue - watermark-smaller.png

Repository

https://github.com/Volentix/venue-server

Details

Our current Python-based system uses the Django REST framework to authenticate users. I would like to instead use AWS Cognito to authenticate users.

  • A new parameter is passed to POST /api/authenticate:
    {
      username: "thor",
      password: "default2018",
      authentication: "cognito" // new, optional parameter
    }
    

  • If and only if authentication=cognito, then the server uses Cognito to authenticate the user. If authentication is successful, then a token is created as it is today on the Venue server.
  • Information about Cognito is configured as an environment variable passed into the system. I'm not sure what information is needed; it is probably best for the developer to create a Cognito User Pool for testing.

The following items are requested, but not mandatory:

  • Parameters from Cognito which are necessary to signin (perhaps just a token) are returned as part of the api/authenticate call; this is probably just cognito_token or something similar. The Cognito token would then need to be saved with the Venue-generated token.
  • The /api/logout function logs out the Cognito user with the saved Cognito token as well as logging out the Venue user.

Other links you might find useful:

Moving the users from the current system to the new system is NOT a part of this project; I have already written a Lambda function which copies users from Django to Cognito. For testing, you should create a user in your Cognito User Pool to confirm that Venue correctly authenticates there.

When this authentication module is complete, the front end will be updated to create new users only in Cognito. Change of emails and change of passwords will also be performed on Cognito. So those parts of the code do not need to be updated either.

As background, this is part of a migration strategy to move from the current Django-based monolithic project to a microservices-based repository, currently hosted on Lambda and deployed by serverless.

Components

Deadline

There is not a hard deadline for this, but I would like it completed the sooner the better. By November 9th would be nice.

Communication

You can contact me via email at [email protected] or on Telegram @shawnlauzon.

The Volentix community is at https://t.me/Volentix

Github

https://github.com/shawnlauzon

volentix-logo-navy.png

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
9 Comments