3

I'm creating a small API using Amazon's AWS Cognito as well as Lambda and a Facebook Login.

When a user / my App sends an API request to Lambda, Cognito does a good job and authenticates the user with it's Facebook-Login on the fly. My point is that as far I can see, Cognito isn't handing on any information about the user (like an ID or the Fb access token), except I'm providing it in my request of course.

In my case, I'd like to get the users Facebook access token in AWS Lambda to do some stuff with it.

Does anyone know how to get any information of the current user, which is hitting the API (like the Fb access token) or is Cognito a closed system in this way?

user3191334
  • 1,148
  • 3
  • 15
  • 33

1 Answers1

6

If you are using the Facebook integration with Cognito User Pool (under federation -> identity providers), you can then map the access_token from the facebook integration to a useable Cognito attribute by going to federation -> attribute mapping -> Facebook tab. the facebook ID is the username, minus the "Facebook_" prefix.

hope this helps!

JoshuaC
  • 349
  • 2
  • 5
  • 2
    Hello JoshuaC can you please elaborate it further. I have the facebook access token need help in mapping it with appropriate user id in Cognito User pool – Aarth Tandel Dec 20 '17 at 07:33