I'm trying to understand if Amazon Cognito can fit our needs, it seems a nice service but I cannot find any documentation that explains how to implement the authentication flow without using the User Pools hosted UI on a Native Mobile App. Right now we managed to do that with email/password but we are not able to do the same with Facebook social login.
So my question is: we use Facebook SDK to get a user's Facebook access token and then? Can I receive a cognito authorization code without using the hosted UI? How?
Thanks.
The Amazon Cognito Hosted UI provides you an OAuth 2.0 compliant authorization server. It includes default implementation of end user flows such as registration and authentication. You can also customize user flows, such as the addition of Multi Factor Authentication (MFA), by changing your user pool configuration.
Before you create a social IdP with Amazon Cognito, you must register your application with the social IdP to receive a client ID and client secret. Create a developer account with Facebook . Sign in with your Facebook credentials. From the My Apps menu, choose Create New App.
The two main components of Amazon Cognito are user pools and identity pools. User pools are user directories that provide sign-up and sign-in options for your app users. Identity pools enable you to grant your users access to other AWS services. You can use identity pools and user pools separately or together.
You can authenticate directly to Federated apps, by redirecting to this,
https://' + domain + '/authorize?identity_provider=' + provider + '&response_type=' + type + '&client_id=' + clientId + '&redirect_uri=' + callback + '&state=' + '&scope=' + scope
here is a sample which I follow in my VueJS app. https://github.com/PaulMaddox/aws-vuejs-cognito/blob/master/src/services/auth.js#L19
Not sure how to do the same in iOS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With