Aws cognito user domain - Invalid_Request

I created a user pool and set up a domain with application client settings () for registering and registering pages in cognitively. When I tried to use a URL similar to -

https://myDomain.auth.us-east-1.amazoncognito.com/login?response_type=code&client_id=fkjfkasjfkasjfdweinfskfsfsfnk&redirect_uri=https://google.com

in the browser I am redirected to

https://myDomain.auth.us-east-1.amazoncognito.com/error?error=invalid_request#

Note. I tried using Cognito User Pool and Facebook listing providers without activating OAuth2.

Did I miss something?

+15
amazon-cognito aws-cognito
source share
3 answers

It works for me with the following user pool settings.

App integration App client settings Enabled Identity Providers ☑ Facebook ☑ Cognito User Pool Callback URL(s) https://google.com OAuth 2.0 Allowed OAuth Flows ☑ Authorization code grant ☐ Implicit grant ☐ Client credentials Allowed OAuth Scopes ☐ phone ☐ email ☑ openid ☐ aws.cognito.signin.user.admin ☐ profile 
+10
source share

Enable the Authorization code grant the Allowed OAuth Flows section of the AppClientSettngs tab

Change redirect_uri as

https://myDomain.auth.us-east-1.amazoncognito.com/login?response_type=code&client_id=fkjfkasjfkasjfdweinfskfsfsfnk&redirect_uri=https://myDomain.auth.us-east-1.amazoncognito.com

It worked for me

0
source share

You are doing everything right from what you described, but you should check the following:

  • Have you added https://google.com to your app client setup as a callback URL?

  • Have you checked your provider Enabled Identity Providers ?

  • In Allowed OAuth Flows you should check the "Grant for Authorization Code".

0
source share

All Articles