Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have social login without Hosted UI in Amazon Cognito?

Tags:

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.

like image 924
marco.santonocito Avatar asked Jun 20 '18 13:06

marco.santonocito


People also ask

What is hosted UI in Cognito?

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.

What information must the company provide to the Amazon Cognito user pool to add each Social IdP?

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.

What are the two main components of Amazon Cognito?

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.


1 Answers

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.

like image 154
Vishnu Prassad Avatar answered Oct 11 '22 10:10

Vishnu Prassad