Skip to content

It is a Ionic starter for integrating the Amazon authorization grant flow with Facebook

License

Notifications You must be signed in to change notification settings

SimoneMSR/aws-mobile-ionic-facebook-auth-grant-flow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Mobile Ionic Starter for Facebook Grant Flow

This project is a fork of the aws-mobile-ionic-sample from aws, created to handle the token refresh when Facebook is used as Itentyty provider, i.e. to enable the Authorization Grant Flow when loggin in with Facebook.

Please, if you have suggestions, make a PR.

Prerequisites

These prerequisites plus:

  • A working Facebook app
  • YARN

Instructions

Assumptions:

In the following, consider the 'config file' to be the client/src/assets/aws_config.js file

Clone this repository: https://github.com/SimoneMSR/aws-mobile-ionic-facebook-auth-grant-flow

AWS side

  1. log in to aws console
  2. go to cognito -> manage my user pool
  3. create/go to your User Pool
  4. take note of your User Pool ID and set to this value the aws_user_pools_id variable in the config file
  5. got to federation-> identity providers -> select facebook
  6. add appId and appSecret of your Facebook app
  7. set profile and email as user info to be read (and other if you need)
  8. go to federation -> attribute mapping
  9. map the email to be the facebook Email
  10. go to general settings -> app clients
  11. create/select your app and take note of the appID and set to this value the aws_app_client_id variable it in the config file
  12. go to app client settings and scroll to you selected app
  13. enable all identity providers
  14. set the callback URL to be http://localhost:8100
  15. flag the Allowed OAuth Flows -> Authorization Code Grant
  16. flag the Allowed OAuth Scopes -> email, openid
  17. go to app integration -> domain name
  18. set the aws_domain_name variable to the domain name in the config file
  19. got to cognito-> manage federate identities -> your identity pool
  20. edit identity pool
  21. make the aws_cognito_identity_pool_id variable in the config file to be you identity pool id
  22. go to authentication providers -> facebook
  23. set the app id
  24. take note of the region of you Identity Pool and set accordingly the value of the variable aws_cognito_region in the config file

Facebook

  1. go to your developer account -> you app
  2. add the Product 'Facebook Login'
  3. go to Product settings
  4. rembember the aws_domain_name variable you set beforehand in the config file
  5. set the Redirect URI as aws_domain_name/oauth2/idpresponse
  6. enable access from Mobile

Build

  1. yarn install
  2. ionic build

About

It is a Ionic starter for integrating the Amazon authorization grant flow with Facebook

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 60.7%
  • JavaScript 19.1%
  • HTML 11.9%
  • CSS 7.8%
  • Shell 0.5%