Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Grant: missing session or misconfigured provider" error in callback (Colyseus integration) #307

Open
dave9011 opened this issue Aug 29, 2024 · 1 comment

Comments

@dave9011
Copy link

Hi,

I'm hoping someone can assist me in figuring out why I am receiving the "Grant: missing session or misconfigured provider" error when attempting to integrate AWS Cognito OAuth into my application using the Colyseus.js library Auth module. See https://docs.colyseus.io/authentication/module

From what I can tell, the issue does not see related to Colyseus, but rather lies within Grant. So far, I'm able to get the pop up to log the user into Cognito, however when the the redirect to the callback happens, I get the error mentioned above. I've traced it back to the callback method in request.js (see

var callback = ({request}) => ({provider, input, output}) =>
) where the provider given does not include the oauth property, but I cannot figure out exactly why that would be.

This is my configuration using the Colyseus integration (https://docs.colyseus.io/authentication/module/#oauth-providers-discord-google-xtwitter-etc):

auth.oauth.addProvider('cognito', {
    key: process.env.CLIENT_ID,
    secret: process.env.CLIENT_SECRET,
    scope: ['openid', 'email', 'profile'],
    subdomain: 'my-poc-app.auth.us-east-1.amazoncognito.com',
    redirect_uri: 'http://localhost:2567/auth/provider/cognito/callback',
});
@simov
Copy link
Owner

simov commented Aug 29, 2024

This error means that the grant cookie got lost. Can you maybe use some of the examples here and try to replicate the issue. It might be easier to debug that way. You only need to update the config.json file and do an npm install, and then run node express.js for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants