AWS Cognito as Authentication Provider: Grant Missing session or misconfigured provider error

System Information
  • Strapi’s version: v3.3.4
  • Operating system: Windows subsystem for Linux ( Ubuntu 16.04 )
  • Database: Strapi’s database for development
  • Node version: 14.15.0
  • NPM Version: 6.14.8
  • Yarn Version: 1.22.10

Grant a missing session or misconfigured provider error :

Basically this is the error that I am getting. Let me elaborate a bit more on what I already achieved, what I am trying to achieve now and how I am getting this error.

Small Note: I am running strapi development server on localhost:8082 instead of a default 1337

What I already achieved:

Following the official documentation from Strapi, regarding setting up AWS Cognito as Strapi’s authentication provider, I managed to connect from my front-end, using strapi react-login example, and everything was set properly both in Cognito’s User Pool as well as on the Strapi’s Authentication Provider configuration side.

Basic flow of the authentication goes like this:

  1. User clicks on front-ends button “Connect with Cognito”
  2. Get redirected to the Cognito’s User Pool Hosted UI
  3. Completes the registration process
  4. Gets redirected back to the front-end

The result of that flow would be a user created inside of User Pool and inside of Strapi’s Users collection.

What I am trying to achieve now and how I am getting this error:

What I am trying to achieve now, is almost the same as what I’ve already achieved by following official Strapi’s documentation, but with one single ( potentially big difference ). I am trying to accomplish the authentication flow without front-end part. So I just want to test whether the authentication would work if I skipped the front-end part, went straight to Cognito’s Hosted UI, and registered a new user. For that to work, in Strapi’s documentation, changes that are recommended are:

/imgur.com/Se5yXoA
picture here ( due to the post url limitations )

resulting with my Strapi’s Cognito Provider configuration looking like this:

/imgur.com/MwCA8cW
picture here ( due to the post limitations )

and here’s my Cognito’s User Pool configuration:

/imgur.com/gUa6eOM
picture here ( due to the post limitations )

After this, by following the above mentioned authentication flow ( going straight to the Hosted UI and registering a new user) user does get created inside of Cognito’s User Pool, get’s redirected to the
localhost:8082/Grant%Missing%session%or%misconfigured%provider%error, and no users get created in Strapi.

I did take a note of Strapi’s advice regarding troubleshooting for this error that I am getting, and made sure that inside of Strapi’s config/server.js I have a properly set up server url:

/imgur.com/QfEce7T
picture here ( due to the post limitations )

I would appreciate any ideas that could help me fix this :slight_smile: Thanks in advance !

1 Like

I just ran into the same problem. Try changing the host from 0.0.0.0 to localhost in config/server.js, as per this comment.