Amazon Cognito web app login

0

Hi Guys, I am checking some examples to use user pool for jwt token. I am seeing oauth2 in examples. Can we have to use jwt only by using Oauth2 in Cognito? I am not using app to app communication, this is just typical username/password and wonder what is the involvement of Oauth2 here? Thanks

ozy
asked a year ago348 views
1 Answer
1

Amazon Cognito supports multiple authentication flows, including OAuth2.0 and JSON Web Tokens (JWT) as well as username/password-based authentication.

When using Amazon Cognito for username/password authentication, you can obtain a JWT access token by calling the InitiateAuth or AdminInitiateAuth API actions after the user has been authenticated. The JWT token can then be used to authorize API calls to other services.

OAuth2.0 is another authentication flow supported by Amazon Cognito. It allows you to use a third-party identity provider, such as Google or Facebook, to authenticate your users. When using OAuth2.0, Amazon Cognito acts as the OAuth2.0 provider and issues JWT access tokens that can be used to authorize API calls to other services.

If you are not using app-to-app communication and only need to authenticate users with username and password, you can use Amazon Cognito's user pools directly without using OAuth2.0. The user pool will handle user authentication and provide a JWT token that can be used to authorize API calls.

In summary, you can use Amazon Cognito user pools to authenticate users with username and password, and obtain a JWT token for API authorization without using OAuth2.0. However, if you need to support third-party identity providers or implement more complex authentication flows, OAuth2.0 can be used with Amazon Cognito as well.

AWS_Guy
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions