feathersjs-ecosystem / authentication

[MOVED] Feathers local, token, and OAuth authentication over REST and Websockets using JSON Web Tokens (JWT) with PassportJS.
MIT License
317 stars 118 forks source link

No cookie/sessionstorage/anything is stored following official oauth2 example from guide. #646

Closed sustained closed 5 years ago

sustained commented 6 years ago

Steps to reproduce

I followed the instructions here from the official guide.

Expected behavior

Authentication should work.

Actual behavior

Everything seems to work and I am redirected to my app with a query parameter (code).

No cookie is ever stored on the client.

The console displays this after logging in:

We have not logged in with OAuth, yet.  This means there's no cookie storing the accessToken.  As a result, feathersClient.authenticate() failed.
index.html?code=...:94 Error: Could not find stored JWT and no authentication strategy was given
    at NotAuthenticated.ExtendableBuiltin (feathers.js:1891)

System configuration

Module versions (especially the part that's not working):

  "dependencies": {
    "@feathersjs/authentication": "^2.1.2",
    "@feathersjs/authentication-jwt": "^2.0.0",
    "@feathersjs/authentication-oauth2": "^1.0.3",
    "@feathersjs/configuration": "^1.0.2",
    "@feathersjs/errors": "^3.3.0",
    "@feathersjs/express": "^1.2.0",
    "@feathersjs/feathers": "^3.1.3",
    "@feathersjs/socketio": "^3.2.0",
    "compression": "^1.7.2",
    "cors": "^2.8.4",
    "feathers-nedb": "^3.0.0",
    "helmet": "^3.12.0",
    "nedb": "^1.8.0",
    "passport-github": "^1.1.0",
    "serve-favicon": "^2.4.5",
    "winston": "^3.0.0-rc2"
  }

NodeJS version: v8.10.0 Operating System: Fedora Browser Version: Chrome 64 React Native Version: N/A Module Loader: ???

sustained commented 6 years ago

I tried using the latest versions of feathers-client and socket.io-client from unpkg.com to no avail.

sustained commented 6 years ago

Have been playing around some more.

With this config, I get sent to a page showing me JSON containing a token:

    "github": {
      "clientID": "...",
      "clientSecret": "...",
      "callbackURL": "http://localhost:3030/auth/github/callback"
    }

And with this config, I get sent to localhost:3030?success and I am still "not logged in":

    "github": {
      "clientID": "...",
      "clientSecret": "...",
      "callbackURL": "http://localhost:3030/auth/github/callback",
      "successRedirect": "http://localhost:3030/?success",
      "failureRedirect": "http://localhost:3030/?failure"
    }

There are way too many moving parts for me to figure out which part of all this is breaking, good luck!

jraut commented 6 years ago

The guide starts with the words The Auk release (v2). You are using Buzzard (v3).

daffl commented 5 years ago

oAuth has been changed significantly in Feathers v4 authentication and does no loner use cookies to transmit the token.

Please see the migration guide for more information. Closing this issue in order to archive this repository. Related issues can be opened at the new code location in the Feathers main repository.