Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service returns [No Auth Token] same by passing Authorization Token on HEADER #641

Closed
abalad opened this Issue Mar 3, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@abalad
Copy link

abalad commented Mar 3, 2018

Steps to reproduce

image

image

image

Expected behavior

The Service returns the data that has been requested.

Actual behavior

When making the request to some Service that is restricted only to authenticated user (authenticate ('jwt', 'local')), even passing the Authorization Token happens following the error

{
    "name": "NotAuthenticated",
    "message": "No auth token",
    "code": 401,
    "className": "not-authenticated",
    "data": {},
    "errors": {}
}

System configuration

Tell us about the applicable parts of your setup.

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

  "dependencies": {
    "@feathersjs/authentication": "^2.1.1",
    "@feathersjs/authentication-jwt": "^2.0.0",
    "@feathersjs/authentication-local": "^1.1.0",
    "@feathersjs/configuration": "^1.0.2",
    "@feathersjs/errors": "^3.2.2",
    "@feathersjs/express": "^1.1.2",
    "@feathersjs/feathers": "^3.1.0",
    "@feathersjs/socketio": "^3.1.0",
    "compression": "^1.7.1",
    "cors": "^2.8.4",
    "feathers-permissions": "^0.1.1",
    "feathers-rethinkdb": "^0.5.1",
    "helmet": "^3.10.0",
    "rethinkdbdash": "^2.3.31",
    "serve-favicon": "^2.4.5",
    "winston": "^2.4.0"
  },

NodeJS version: 7.7.1

Operating System: WIndows 10

Browser Version: Crome 58/Postman

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Mar 4, 2018

Can you try limiting to just authentication('jwt') instead of authentication('jwt', 'local')? This is probably similar to #577 but might also be related to #623

@abalad

This comment has been minimized.

Copy link
Author

abalad commented Mar 4, 2018

It was with authentication ('jwt') I ended up adding the authentication('jwt', 'local') to try to verify if that was not what was missing. Even tried to pass this way authentication(['jwt', 'local']) and even then the error happens

@97-109-107

This comment has been minimized.

Copy link

97-109-107 commented Mar 19, 2018

@abalad Did you find a solution?

@abalad

This comment has been minimized.

Copy link
Author

abalad commented Mar 20, 2018

@97-109-107 I upgraded to the latest version of the FeathersJS packages and ran the services again. In this way, this error stopped sending the requests via Postman.

However @daffl , informed me in another issue that the correct thing is to use socket, hence in my application I changed everything to work with socket.

Because I was performing authentication via Rest and making some requests with Socket, that's where my problem occurred in my application.

Summing up:
1- Update your server to the latest version and Re-create your services with it
2- In your application change your requests, mainly the one that performs the authentication to work with socket.

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Mar 20, 2018

Ah, if that was the issue then I think we can close this. There usually is no reason to use both, REST and Sockets in the same app (in fact, websockets are almost always the better choice especially if you need real-time updates) but if you do they both have to be authenticated individually.

@daffl daffl closed this Mar 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.