Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws cognito user pool domain - Invalid_Request

I have created a user pool and setup domain with app client settings () to host sign up and sign in pages in the cognito itself. When I tried using the 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 identity providers without OAuth2 enabled.

Am I missing something?

like image 790
user3600073 Avatar asked Aug 23 '17 05:08

user3600073


People also ask

How do I get a user pool domain?

Navigate to the App integration tab for your user pool. Next to Domain, choose Actions and select either Create custom domain or Create Cognito domain. If you have already configured a user pool domain, choose Delete Cognito domain or Delete custom domain before creating your new custom domain. Choose Create.

What is callback URL in Cognito?

A callback URL indicates where the user will be redirected after a successful sign-in. Enter Sign out URL(s). A sign-out URL indicates where your user will be redirected after signing out. Select Authorization code grant to return an authorization code that is then exchanged for user pool tokens.

What is the difference between Cognito user pool and identity pool?

Short description. User pools are for authentication (identity verification). With a user pool, your app users can sign in through the user pool or federate through a third-party identity provider (IdP). Identity pools are for authorization (access control).


2 Answers

It works for me with 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
like image 126
Maksim Aniskov Avatar answered Sep 16 '22 20:09

Maksim Aniskov


You're doing everything correct from what you've describe, but you should check the following,

  • Have you added https://google.com in App Client Setting as Callback URL?

  • Have you checked your Identity Provider in Enabled Identity Providers?

  • In Allowed OAuth Flows, you must have checked "Authorization Code Grant".

like image 24
Mukul Jain Avatar answered Sep 18 '22 20:09

Mukul Jain