fief-dev / fief

Users and authentication management SaaS
https://www.fief.dev
Other
486 stars 42 forks source link

Login session tenant is incorrectly checked in /oauth/callback #256

Closed frankie567 closed 10 months ago

frankie567 commented 10 months ago

Discussed in https://github.com/orgs/fief-dev/discussions/254

Originally posted by **tito** August 18, 2023 Hi, I have a self-hosted version of Fief (0.26.0), with the default Fief workspace and multiple Tenant. I configured Github OAuth as described, and activated for a specific tenant. From my Next JS app, i see the following process: 1. `https://myapp.com/login` (provided by fief-js) -> returns HTTP 307 2. `https://fief.myapp.com/mytenant/authorize?response_type=code&...` -> returns HTTP 302 3. `https://fief.myapp.com/mytenant/login` -> returns HTTP 200 4. I click on the github button 5. `https://fief.myapp.com/oauth/authorize?tenant=xxxxxxx&provider=xxxxxxx` -> returns HTTP 302 6. `https://github.com/login/oauth/authorize?response_type=code&client_id=xxxx&redirect_uri=https%3A%2F%2Ffief.myapp.com%2Foauth%2Fcallback&state=xxxx&scope=offline_access+openid+user+user%3Aemail` -> returns HTTP 302 7. `https://fief.myapp.com/oauth/callback?code=xxxx&state=xxxx` -> returns HTTP 400 With the error "Invalid login session" What did i do wrong ?
frankie567 commented 10 months ago

@all-contributors add @tito for bug

allcontributors[bot] commented 10 months ago

@frankie567

I've put up a pull request to add @tito! :tada: