Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The 1st example with mapping doesn't work #7

Open
bz123 opened this issue Jun 2, 2017 · 2 comments
Open

The 1st example with mapping doesn't work #7

bz123 opened this issue Jun 2, 2017 · 2 comments

Comments

@bz123
Copy link

bz123 commented Jun 2, 2017

Thanks for all the work you've done but am having an issue with mapping.

This part of the first example doesn't seem to work:
Config.credentials = new CognitoIdentityCredentials({ IdentityPoolId: appConfig.IdentityPoolId, Logins: { [cognito-idp.${appConfig.region}.amazonaws.com/${appConfig.UserPoolId}]: result.getIdToken().getJwtToken() } });

On my online dashboard for that userpool I can't see that specific user being logged in.

Same happens when am trying to map back a facebook access token to generate a JWT token from the session.

Any Ideas?

@jmparsons
Copy link
Contributor

Are you using react native facebook login to get an access token? The way it works is you need the access token from Facebook sdk and pass that to the Logins array in cognito. Then when credentials is set you'll be able to get a session off the user.

@jmparsons
Copy link
Contributor

Essentially mimic this:

http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-browser-credentials-cognito.html

The access token comes from Facebook.

To get the session and any other information refer to the amazon cognito identity js sdk for use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants