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

How to add social (facebook/google etc.) authentication to user pool (not identity pool) without hosted UI? #1434

Open
JurajBegovac opened this issue Jan 15, 2020 · 15 comments
Labels
cognito Issues with the AWS Android SDK for Cognito feature-request Request a new feature

Comments

@JurajBegovac
Copy link

JurajBegovac commented Jan 15, 2020

Hi,

we're using Cognito userpool to create users (to perform authentication that we use on our BE - so to get access and refresh token) - it's working fine when adding a user with an email but I got stuck when I tried to achieve it with some social provider (e.g. Facebook).

As far as I know, adding a user with some social provider is possible only with HOSTED UI:
https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html

Why?

That's not native for Android - I don't want to launch a browser (or chrome custom tab or webview) to create a user with Facebook. Ideally, I would like to fetch Facebook token with Facebook SDK and pass that token to Cognito to create a user in user pool.

Also, I went through this sample:
https://github.com/awslabs/aws-sdk-android-samples/tree/master/AmazonCognitoAuthDemo

and created auth like this:

 Auth.Builder builder = new Auth.Builder().setAppClientId(getString(R.string.cognito_client_id))
                .setAppClientSecret(getString(R.string.cognito_client_secret))
                .setAppCognitoWebDomain(getString(R.string.cognito_web_domain))
                .setApplicationContext(getApplicationContext())
                .setAuthHandler(new callback())
                .setSignInRedirect(getString(R.string.app_redirect))
                .setIdentityProvider("Facebook") // <--- !!! ADDED THIS
                .setSignOutRedirect(getString(R.string.app_redirect));

But that snippet is just opening an url with chrome custom tabs so - it doesn't look and feel natively and it works only if user has Chrome browser installed...

This issue is almost similar as #370 but that one is old and it was not resolved so I opened a new one.

Please can you answer if what I described is possible or we can take a look at other alternatives like Firebase (or is there a way to hack/fake identity pool to insert a user in user pool after doing federatedSignIn ?).

Thank you in advance

@JurajBegovac JurajBegovac changed the title How to add facebook/google etc. login to user pool (not identity pool) without hosted UI? How to add social provider (facebook/google etc.) authentication to user pool (not identity pool) without hosted UI? Jan 15, 2020
@JurajBegovac JurajBegovac changed the title How to add social provider (facebook/google etc.) authentication to user pool (not identity pool) without hosted UI? How to add social (facebook/google etc.) authentication to user pool (not identity pool) without hosted UI? Jan 15, 2020
@jamesonwilliams jamesonwilliams added cognito Issues with the AWS Android SDK for Cognito question General question labels Jan 17, 2020
@TrekSoft
Copy link
Contributor

Cognito currently doesn't support this but we are in touch with them about adding this functionality so will update as we find out more.

@RecargoJereld
Copy link

Any updates on this issue? Forcing a min sdk level of 23 prevents 15% of the Android audience from being able to use any apps that integrate Hosted UI.

@TrekSoft
Copy link
Contributor

The original issue asked about here is on our roadmap for this year - it sounds like you're asking about a different one though with the min level SDK.

@RecargoJereld
Copy link

Thanks for the reply. That's great to know.

It was tangential comment about how if we want to use social sign in with Cognito User Pools we have to use Hosted UI which has the min sdk level requirement.

@TrekSoft
Copy link
Contributor

TrekSoft commented May 15, 2020

Gotcha gotcha - yeah we have a separate issue open for that here which we plan to look into soon as well: #471

@rafcpz
Copy link

rafcpz commented Jul 11, 2020

@TrekSoft
Copy link
Contributor

They changed the branch name so the link is now: https://github.com/awslabs/aws-sdk-android-samples/tree/main/AmazonCognitoAuthDemo

@kirillvasilenko
Copy link

Any updates on this issue?

@richardmcclellan richardmcclellan added feature-request Request a new feature and removed question General question labels Jun 15, 2021
@ShyamSampath
Copy link

Any updates on this issue?I have been looking for the update on similar issues for more than a year now and none of the issues got an update.

@taouichaimaa
Copy link

@Inshaki
Copy link

Inshaki commented Jun 23, 2022

Any updates here?

@xaluxs
Copy link

xaluxs commented Apr 30, 2023

Any news on this, I would not want to move to firebase and have two different mechanisms

@abdallahshaban557
Copy link

Hello everybody! Our team is working with the Amazon Cognito team to allow developers to build native social sign in experiences, without using HostedUI. We will provide further updates when we have clarity on our timelines.

@hArsh92
Copy link

hArsh92 commented Jan 26, 2025

Any updates here?

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Jan 26, 2025
@tylerjroach
Copy link
Member

I'm sorry that we do not have any updates to provide at this time. Internally, we will continue discussions with the Cognito team to understand if this is a feature on their roadmap.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cognito Issues with the AWS Android SDK for Cognito feature-request Request a new feature
Projects
None yet
Development

No branches or pull requests