4

Background

I'm making use of the Strapi Headless CMS as my application backend and React for my frontend. Strapi provides a ready-made plugin for handling authentication (within the application and for making use of third party OAuth providers). Both the backend and frontend are deployed using AWS Fargate instances for multiple environments (Development [not local], Staging and Production). I make use of Sqlite for local testing and MySQL Aurora for Development, Staging and Production.

Problem

The issue I'm having may relate to Strapi or AWS. I've managed to configure the strapi plugin for making use of Google and Facebook authentication. I've created my project on Google, created my OAuth credentials and specified the relevant redirect urls. I've done similar for Facebook as well. I've tested Google authentication using my local machine and it appears to work correctly. I haven't tested Facebook locally because they do not allow localhost urls (I could test this using ngrok but haven't done so as yet). The issue that occurs is that I get the following error:

Grant missing session or misconfigured provider

This occurs on all 3 environments after I've selected the Google account I'd like to use or entered my Facebook credentials. The error gets thrown by strapi in the form of this url: https://mybackend.org/?error=Grant%3A%20missing%20session%20or%20misconfigured%20provider#. I'm 80% sure that the provider is configure correctly since it works locally. The only option is the grant is missing the session. I'm not entirely sure what this means.

In terms of the network requests that occur when I initiate the authentication: A 302 error is returned when making the get request to https://mybackend.org/connect/google/callback?code=“my code”. This occurs after selecting the Google account that I’d like to use for authentication. There is also a 302 error that occurs before this but it also happens when I test locally. The url is: https://accounts.google.com/signin/oauth/consent?authuser=0&part=“additional parameters”

I've already posted this on the strapi forum and have not received a response.

I can provide any additional information that is needed, please assist.

  • This is a pretty old question so I figure you've probably moved on. But can you see what the API request that returns the error is? If you have Strapi running in a console somewhere it should show the request URL that results in the 302 error – Pierre Baudin Oct 04 '22 at 17:09

0 Answers0