JWT Authentication vs _users #2945
-
In the doc, it is stated that:
And
I'm not sure I fully understand this. Let's imagine that I have a user in the "_users" database, with the following id: Currently, I'm using "_users" as the single source of truth for authentication in my system and those users are associated with roles in the different databases. Our users authenticate against a RESTful API that delivers them a JWT token. Later on, our system will most probably switch to Auth0 or a similar 3rd party solution but I don't know yet what we'll do with the user information and roles configuration (ie., keep it in couch or externalize it). What happens if I enable JWT authentication and provide "org.couchdb.user:foo" as Will Couch recognize the user presenting that token as the user part of _users with the same user identifier (and grant him the same level of access), or will Couch consider it as a completely independent user for which roles should be defined within the JWT token? Are both scenarios possible? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This turned out to be wrong. JWT auth works like proxy auth, and usernames and roles are defined externally and CouchDB just inherits them. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the heads up @janl! |
Beta Was this translation helpful? Give feedback.
_users
is the source of truth in either case. JWT is just a different way of identifying users (next to HTTP Basic Auth and the existing Session auth).This turned out to be wrong.
JWT auth works like proxy auth, and usernames and roles are defined externally and CouchDB just inherits them.