State your question
I'm looking for an official flow to how to create a user in an UserPool after using the federatedSignIn through the Drop-in Auth UI any ideas on it?
Which AWS Services are you utilizing?
Cognito
Environment(please complete the following information):
This would be ideal...and I'm not sure why this isn't possible...the only thing lacking using aws cognito sdk vs other providers imo
Hello @AngeloGiurano
Currently this feature is not supported by the Cognito Service. For creating a UserPool user when using Social Providers, it can only be done when using Hosted UI. I will take this as a feature request to the team.
On side note, starting 03/14 AWSMobileClient now supports the HostedUI flow as well which you can use in your app. You can find the documentation here: https://aws-amplify.github.io/docs/ios/authentication#using-hosted-ui-for-authentication
Thanks,
Rohan
Hi @rohandubal, thank you for your reply.
I will try out the HostedUI and I do appreciate taking this as a feature request, hope the support for for the Drop-In Auth UI will take into consideration from the team and will be available in future!
Thank you!
hey @AngeloGiurano any luck with getting the HostedUI working?
@Marquis103 Yes, it works correctly :)
@AngeloGiurano what provider are you using it with? It works (creates a user in user pool) for me for OpenID (we use Twitch) but it doesn't work for me when using facebook.
@rohandubal I'm using the following code:
let hostedUIOptions = HostedUIOptions(scopes: ["openid", "email", "aws.cognito.signin.user.admin", "profile", "phone"], identityProvider: "Facebook")
// Present the Hosted UI sign in.
AWSMobileClient.sharedInstance().showSignIn(navigationController: self.navigationController!) { (userState, error) in
print(userState)
print(error)
if let error = error as? AWSMobileClientError {
print("error signing in", error)
}
if let userState = userState {
print("Status: \(userState.rawValue)")
}
AWSMobileClient.sharedInstance().getUserAttributes(completionHandler: { (attrs, error) in
print(attrs)
print(error)
})
}
In the completion handler, the state is signedIn, but when I go to immediately get user attributes, I get AWSMobileClient.AWSMobileClientError.notSignedIn(message: "User is not signed in, please sign in to use this API.")), and a user in my user pool is not created. But it all works fine when I use my Open ID provider let hostedUIOptions = HostedUIOptions(scopes: ["openid", "email", "aws.cognito.signin.user.admin", "profile", "phone"], identityProvider: "Twitch")
any ideas?
@kriztoph Facebook and google both won't create a user in the user pool and you are using the HostedUI and not the Drop-in Auth UI
@kriztoph Facebook and google both won't create a user in the user pool and you are using the HostedUI and not the Drop-in Auth UI
Hi, If this is the case, how should I use Cognito user pool as the authentication provider attached to API GW. I initially thought to attach API GW to Cognito User Pool to authenticate API requests.
Creating a user in UserPool after social provider authentication is currently supported only if you use HostedUI. This has been taken as a feature request to Cognito.
Closing this as duplicate #1937
Most helpful comment
This would be ideal...and I'm not sure why this isn't possible...the only thing lacking using aws cognito sdk vs other providers imo