AnomalyInnovations / serverless-stack-demo-client

Source for the demo app client in the Serverless Stack Guide
https://demo2.serverless-stack.com
MIT License
635 stars 204 forks source link

Add facebook login sign-in #26

Closed jatazoulja closed 5 years ago

jatazoulja commented 6 years ago

Cognito Setting:

  1. navigate to your cognito userpool then navigate to App Integration > Domain name and add your subdomain: screen shot 2018-02-13 at 9 48 34 am
  2. navigate to your cognito userpool then navigate to Federation > Identity Provider: (Please note that you should provide your fb api key and secret key from https://developer.facebook.com) screen shot 2018-02-13 at 9 50 13 am
  3. Map your facebook attribute to cognito attribute: (this are some of the recommended settings) screen shot 2018-02-13 at 11 15 17 am

Facebook Setting:

  1. add a new app.
  2. choose Facebook Login and then pick "web"
  3. at the first step add your url then save and continue. screen shot 2018-02-13 at 8 06 19 pm
  4. disregard the rest of the step.
  5. Go to your facebook login setting and add a valid Oauth redirect url: https://.auth..amazoncognito.com/oauth2/idpresponse screen shot 2018-02-13 at 9 52 48 am

NOTE: you can get your app key and secret key at the dashboard setting:

screen shot 2018-02-13 at 8 08 06 pm
jayair commented 6 years ago

@jatazoulja Thanks! This is really helpful. I cannot merge this PR but I'm going to link to this in our newsletter and in the tutorial.

jatazoulja commented 6 years ago

Sure have it as reference... BTW do you have plans to update to aws amplify? I hears cognito-identity-js will be discontinued and will be part of amplify...

Cheers

jayair commented 6 years ago

@jatazoulja Yeah we are in talks with the Amplify team to update Serverless Stack with it. Should have some announcements soon.

jatazoulja commented 6 years ago

Great! Looking forward to it!

peetss commented 5 years ago

@jayair Why can't we merge this?

jatazoulja commented 5 years ago

@peetss I believe this is an old code. if you want to use it you can follow the instruction, and I believe this is pre aws-amplify version. I do have another version: https://github.com/AnomalyInnovations/serverless-stack-demo-client/pull/31

Note on this PR: this PR uses cognito custom UI. that requires callback (I don't see that callback on the latest aws-amplify yet). Pros: it uses cognito user pool and you can track user for social oAuth to your pool.

Cheers.

jayair commented 5 years ago

We just published a chapter based on @jatazoulja's new PR - https://serverless-stack.com/chapters/facebook-login-with-cognito-using-aws-amplify.html. Closing this!