Comments (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.
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.
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)
- Apple auth with scopes not working correct
- Mastodon OAuth implementation has no handling for the email field.
- wecom provider has bug. cached client will be using for everybody....
- has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
- How to check that users are logged in?
- mailru error
- Bitbucket Authentication Error HOT 1
- Microsoft authentication error
- authentik provider HOT 1
- Group Retrieval For Google Sessions
- Passing parameters between the login and the callback functions HOT 6
- Epic Games Provider
- Could not get name from Google with goth HOT 2
- deprecated lib HOT 1
- Alternative Session option
- global_name in RawData not used in discord provider
- Just a question: how may I tell "goth" library what proxy server it has to use?
- When should you generate the code challenge for a `goth`/`gothic` PKCE OAuth flow? HOT 1
- LinkedIn deprecated OAuth login in favour of OIDC HOT 3
- Session is not saved due to logout
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goth.