Code Monkey home page Code Monkey logo

Comments (3)

kalnode avatar kalnode commented on July 18, 2024 3

Hello, commenting as this was my issue today. Basically, all of your URLs need to match.

In my case, using Google:

After setting up Goth, my test (Google) login URL was "http://localhost:3000/auth/gplus", however this threw an error "could not find a matching session for this request". I couldn't understand why.

My callback URL as defined in the Google developer console was "http://www.lvh.me:3000/auth/gplus/callback", which technically would be a working URL, however I suppose it's a security issue where the domains do not match. On my Google developer console (the credentials area), when I setup the callback URL, I was not allowed to use any "localhost" type of URLs. Instead, since I don't have hosting ready yet, I used "lvh.me:3000", a free service which points a domain to your personal localhost.

So, when I visit "http://localhost:3000/auth/gplus" to test, I get forwarded to the Google login area just fine, however an error is thrown when it's time to return to the callback URL. Since my original entry page "localhost:3000" does not match my callback URL, there is a problem, I suppose it's seen as a secruity thing.

Instead, now I still test locally using "http://lvh.me:3000/auth/gplus" and everything works.

None of this will matter when I move to a proper live host and can use the same domain everywhere.

So, make sure all of your URLs match. Later on you can explore making changes otherwise.

from goth.

drnic avatar drnic commented on July 18, 2024 3

For my own future reference, I got this error when I started my app at http://localhost:9393 but was redirected back to http://127.0.0.1:9393 (App().Host was returning 127.0.0.1). The issue when away when I started with http://127.0.0.1:9393 in the browser.

from goth.

willemvd avatar willemvd commented on July 18, 2024

For the example to work you need to set the "Valid OAuth redirect URIs" to "http://localhost:3000" on the page https://developers.facebook.com/apps/ your app id /fb-login/ and enter the example application with http://localhost:3000

This error may occur when you run the example application behind some proxy and it's available with multiple urls like https://foo.com which is a proxy redirect to http://localhost:3000
When you initially entered the example application with https://foo.com and set the redirect uri in facebook to http://localhost:3000 (or the other way around), than the session is not bound to the same request (foo.com vs localhost:3000) and the "could not find a matching session for this request" will be returned

from goth.

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.