简体   繁体   English

带有Facebook的AWS Cognito用户池

[英]AWS Cognito User Pool with Facebook

I have an AWS Cognito User Pool that I am trying to add Facebook login to on an Android application. 我有一个AWS Cognito用户池,我正在尝试在Android应用程序上添加Facebook登录名。 My application currently signs in with facebook successfully but does not create a user in my user pool. 我的应用程序当前已成功使用Facebook登录,但未在用户池中创建用户。 I have followed the instructions here 我已经按照这里的指示

https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html#cognito-user-pools-social-idp-step-1 https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html#cognito-user-pools-social-idp-step-1

and the test url creates a user ( https://my_pool/login?response_type=code&client_id=my_id&redirect_uri=app:// ). 然后测试网址会创建一个用户( https:// my_pool / login?response_type = code&client_id = my_id&redirect_uri = app:// )。 Inside my app I get a successful response from Facebook and have configured my Facebook Developer App with the settings in the url. 在我的应用程序内部,我得到了Facebook的成功响应,并使用url中的设置配置了我的Facebook Developer App。 Can anyone help as to why there is no user created? 谁能帮忙为什么没有创建用户?

LoginManager.getInstance().registerCallback(mFacebookCallbackManager,
            new FacebookCallback<LoginResult>() {
                @Override
                public void onSuccess(LoginResult loginResult) {
                    // App code
                   Log.d(TAG, "Success");
                   --> This is called.
                }

                @Override
                public void onCancel() {
                    // App code
                    Log.d(TAG, "onCancel");
                }

                @Override
                public void onError(FacebookException exception) {
                    // App code
                    Log.d(TAG, "onError");
                }
            });

A new Amazon Cognito user is not created automatically when a Facebook user performs a login. 当Facebook用户执行登录时,不会自动创建新的Amazon Cognito用户。 To create a Cognito account, you need to use Cognito's hosted UI. 要创建Cognito帐户,您需要使用Cognito的托管UI。 There is a library distributed through Gradle available as implementation 'com.amazonaws:aws-android-sdk-cognitoauth:2.9.1 (or whatever number is latest). 有一个通过Gradle分发的库,可作为implementation 'com.amazonaws:aws-android-sdk-cognitoauth:2.9.1 (或最新编号)使用。

A sample can be found at https://github.com/awslabs/aws-sdk-android-samples/tree/master/AmazonCognitoAuthDemo 可以在https://github.com/awslabs/aws-sdk-android-samples/tree/master/AmazonCognitoAuthDemo找到示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM