'AWS cognito authentication flow with React frontend and Go backend

I'm building a web app that has a React frontend and a Go backend; I'd like to build out the backend to call services and do other things instead of just having a front-end based app. To my understanding from some other posts, the authentication flow should be as follows:

  1. Client inputs username and password
  2. Frontend calls AWS Cognito user pool to verify credentials. If correct, JWT tokens are sent back to frontend.
  3. The frontend sends these tokens to the backend
  4. The backend verifies the tokens and checks the access token is valid.
  5. If valid, the backend then uses the ID token for other services.

Is this correct? If so, then I'll need a Javascript + Go Cognito SDK?

Furthermore, it seems AWS has Cognito support for Amplify but I don't see docs for just Javascript or Go. I did find functions in the Javascript and Go SDK, though; however, I couldn't find examples how to use them properly. Would anyone know of a good resource?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source