1

Basically I want the below flow in the application .

I have created one user pool in the cognito and configure it.

I want to integrate cognito authentication and authorization with below flow.

  1. Register new user with by using cognito signUp api via postman (I dont want to use hosted UI) .

once user is successfully registered in cognito.

  1. User will call the cognito login api via postman - On successful login cognito will return access_token.

  2. I will use that access token in all subsequent requests to make sure the user is authenticated and authorized .

The main thing here is I do not want to use that hosted UI given by cognito .I want to achieve this via api calls .

I am not sure for achieving this what I need to . You can tell me if any more steps needed before the first step I wrote like authorize my app or anything like that.

I understood I need to authorize my app before it uses the signup api but I am not sure about exact flow and process or in which manner I need to perform the steps .

Please guide..

  • What is the reason behind creating users in postman? You can instal AWS CLI and use curl request. Or somehow it is necessary for you to achieve this in postman then you can use the following: Create lambda functions and use aws sdk for creating users in cognito Configure API gateway to access that lambda Use it in postman. I can post a detailed answer with an example but first need to know what exactly your are trying to do. – Shafqat Jamil Khan Feb 17 '21 at 11:40
  • @ShafqatJamilKhan : Hi Shafqat , thanks for replying.I want to achieve below. end user hit myapp_sign_up. it will call my app Backend api BackEnd api call cognito signup api . cognito return response (success/fail). Based on this response my app api give response to my end user (success/fail). I want to achieve this flow thats why I want to test my stage 3 directly from postman before coding that into my applications BE. – Akshay Champavat Feb 18 '21 at 04:16
  • There are aws sdks available for different platform. You need to implement one of them according to your backend technology and expose your api and test it out in the post man. Please go through this link https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_SignUp.html There are sdks links at the bottom. Let me know if you need any further assistance. – Shafqat Jamil Khan Feb 18 '21 at 04:58
  • Also check this out, https://stackoverflow.com/questions/52287506/how-do-i-integrate-amazon-cognito-login-in-postman – Shafqat Jamil Khan Feb 18 '21 at 05:00
  • Yes , I got your solution . I need to use SDK and then need to call methods of signup from which is provided by SDK . and based on that methods response I need to give response back to my end user . perfact ! please upvote question so if any one is looking for same can get help. Thank you . – Akshay Champavat Feb 18 '21 at 15:44
  • I am glad it helped you. Please accept the answer. Upvoting. – Shafqat Jamil Khan Feb 18 '21 at 16:18

1 Answers1

1

There are aws sdks available for different platform. You need to implement one of them according to your backend technology and expose your api and test it out in the post man. Please go through this link docs.aws.amazon.com/cognito-user-identity-pools/latest/… There are sdks links at the bottom.

Shafqat Jamil Khan
  • 1,039
  • 1
  • 9
  • 17