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

Viewed 5894

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?

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!
Related