'Login option is not available. Please try another one

I followed the Amplify instructions to add a email login, now I am adding a Google login, and I'm getting this message instead:

Login option is not available. Please try another one

enter image description here



Solution 1:[1]

The documentation is not clear.

The Amplify CLI does not add a Google Identity Provider. It also changes the domain name unexpectedly.

You have to go in the AWS console, select your User Pool, and add the Google Provider yourself, and enable it in App Client Settings.

After I selected Google, and enabled it in Enabled Identity Providers, then it worked.

Also, it seems like the CLI wants to put all sign ins on the same web page, if you use signInWithWebUI, but I think this is ok.

enter image description here

Solution 2:[2]

It fixed my issue by going to Cognito User Pool -> Federation -> Identity Provider -> select Google -> fill out "Google app ID", "App secret"(find those in your Google cloud) and "Authorize Scope"(profile email openid). -> Go to "App Client Settings" to enable "Google"

Note: you might find this video useful https://www.youtube.com/watch?v=pKA8qXINjkU, tho it is not specific to setting up Cognito through Amplify

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2