Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fixing Amazon Cognito - Sign In With Apple - "Invalid State/RelayState provided"

I have been working with Amazon Cognito User Pools and have Apple set up as an identity provider in my User Pool. After going through the OAuth2 flow to create an account with Apple, Cognito's hosted UI redirects me to a page that simply shows the error "Invalid State/RelayState provided". How can I fix this issue?

like image 841
Chris Gilardi Avatar asked Mar 31 '20 17:03

Chris Gilardi


People also ask

How do you authenticate on Amazon Cognito?

Go to AWS Cognito service and click “Manage Identity Pools”. 2. Enter “Identity pool name”, expand the “Authentication providers” section and select “Cognito” tab. This is where the Cognito authentication provider will be registered with the Identity pool.

How do I get rid of Amazon Cognito?

Navigate to the App integration tab for your user pool. Next to Domain, choose Actions and select Delete Cognito domain or Delete custom domain. Enter the domain name to confirm deletion.


1 Answers

This badly-described error can be caused by failing to enable an identity provider for the app client you are using to authenticate the user.

You can enable an identity provider by doing the following:

  1. Navigate to your User Pool configuration in the AWS Console
  2. Choose App Integration -> App Client Settings in the left sidebar
  3. Choose the app client (or multiple) you want to enable the provider for
  4. Ensure the provider is checked under Enabled Identity Providers
  5. Save!
like image 83
Chris Gilardi Avatar answered Sep 22 '22 15:09

Chris Gilardi