4

Having trouble understanding the authorization flow of FB users and AWS Cognito User Pools. I have followed this guid.

  • facebook login app has my redirect uri https://<cognitoname>.auth.us-east-1.amazoncognito.com/oauth2/idpresponse
  • aws cognito has my facebook appid and secret

Two issues:

1) I'm expecting when my android app authenticates with fb (via login button), the fb server sends something to my userpool adding that user. that is not happening. I dont see a method in the CognitoUser object to do this on my end with the loginResult from fb. No user is getting created in the userpool upon fb auth.

2) Assuming a fb user were to be created in my pool, how would I call getSessionInBackground without the password? It does not look like the android Congito Classes have a way to handle this.

Also, i am able to log in a fb user to a federated identity but i dont think that is what i want unless its part of the user pool process.

Vasileios Lekakis
  • 5,492
  • 2
  • 15
  • 17
  • Have you figured this out? I'm in the same boat, I've got my User Pool configured to Federate to Google. When I test authentication in a browser it works and the browser is redirected to my redirect URI with a "&code=" which looks like it could be a token, and the pool grows by 1 user. But I cannot find the API to do the same thing on Android. 1- how to launch the signin from the android app, 2- how to get that code back inside the app. https://stackoverflow.com/questions/49547452/how-to-use-federation-from-a-user-pool-not-from-an-identity-pool – mipnw Mar 30 '18 at 06:21

1 Answers1

0

Based on your description of use case, you may first use Cognito Android Auth SDK to get authenticated and store the tokens. Then you may use Cognito Android CUP SDK to call getSessionInBackground.

Also a quick tip: CUP Android SDK: The Adv Security, Adaptive Auth, and new MFA support is available from version 2.6.9 Cognito Auth Android SDK: The Adv Security support is available from version 2.6.9. The Adaptive Auth and new MFA support will be available through Springboard on the supported regions.

  • Are you referring to this [getSessionInBackground](http://docs.aws.amazon.com/AWSAndroidSDK/latest/javadoc/com/amazonaws/mobileconnectors/cognitoidentityprovider/CognitoUser.html#getSession-com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler-)? That takes the AuthenticationHandler callback which requires a password, which i dont have since they authorize through facebook. – jamescharlesworth Dec 15 '17 at 11:24