Git Product home page Git Product logo

Comments (10)

simov avatar simov commented on April 28, 2024

This generic error message was introduced here #23 Is it possible that you are experiencing it in similar circumstances?

from grant.

Eruant avatar Eruant commented on April 28, 2024

I start at:
get /connect/<my-provider> {} 302 which redirects me to OAuth2 server.

I then get redirected back to:
get /connect/<my-provider>/callback {"code":"<code>","state":"<state>"} 200

When looking at the grant variable (in grant npm package) it is set to {}. It looks as if the session never got set.

from grant.

simov avatar simov commented on April 28, 2024

Missing session can definitely result in that error. Which framework+version do you use, Express, Koa, Hapi?

Take a look at these tests: https://github.com/simov/grant/blob/master/test/consumer/express/error.js#L180-L243

If the bare minimum configuration is missing in either the connect or the callback routes in Grant, then Grant simply tells you that either your configuration is incorrect, or your session data is missing for some reason.

Either way Grant is not trying to fix your errors, if you provide me with a code example sufficient enough to reproduce the bug, I would probably be able to help you.

from grant.

Eruant avatar Eruant commented on April 28, 2024

I'm using Hapi.

I've investigated this further, and it seems that all cookies stored by yar get wiped upon return from the my OAuth2 provider. It looks like this issue is either coming from yar or my provider.

This issue can be closed for now. It seems most likely that the issue isn't being caused here.

from grant.

simov avatar simov commented on April 28, 2024

Can you give me the exact version of Hapi and Yar that you are using? That way I can at least run the test suite against them. Currently the Hapi version used for testing is pinned to an older version due to compatibility issues with older versions of Node.

from grant.

Eruant avatar Eruant commented on April 28, 2024

Sure, here you go

Package Version
hapi 15.0.3
yar 7.0.2
grant-hapi 3.6.4
node 6.5.0
npm 3.10.6

Edit: I've also tried it with node 4.5.0 and npm 2.15.9 with the same results

from grant.

simov avatar simov commented on April 28, 2024

Tests seems to be passing on my end. I'm closing this issue for now, feel free to re-open it and/or add something to it.

from grant.

Eruant avatar Eruant commented on April 28, 2024

I've had some success with Safari, but not Chrome or Firefox. It could possibly be related to the way the cookies and sessions are set. If I figure this out I'll add the solution in case anyone else has the same issue in the future.

from grant.

simov avatar simov commented on April 28, 2024

That would be great! 👍

from grant.

Eruant avatar Eruant commented on April 28, 2024

The issue appears to be with yar, and so I've opened a new ticket:
hapijs/yar#101

from grant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.