-
Notifications
You must be signed in to change notification settings - Fork 178
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
ACL checks for a combination of files & jwt backend not working #279
Comments
This sounds like a bug I'll need to look into, the error should be simply skipped and the ACL check pass because of the files entry. |
@bilgeexuu1 I think you're commenting in the wrong issue. |
I don't know if this is related, but I had an issue with using jwt with its own acl file. Looking at jwt_files.go
To me this should say either
Or simply (to avoid getUsernameForToken twice (since CheckAcl does it, and this backend requires an acl to be defined in its NewFilesJWTChecker factory, unless I'm mistaken):
This works when I compile it with the latter change - it never authenticates otherwise because checkAuth will always return false from the call in backends.go Unless I've missed a configuration I can set to avoid the user name password checks for this case (so that it just acl checks against the username claim in the encoded jwt), then I don't know. Here is my config:
|
To be clear, this is more about an issue with the jwt backend when it's in files mode, than with the files and the jwt backend combined, so maybe it belongs in a different issue. |
Yep, this is unrelated, so please open a different issue. |
I've added a pull request here in response to this issue |
Hey,
when I use the files backend, everything works as expected.
But when I enable the jwt backend using
auth_opt_backends files, jwt
it gives me:I think the ACL check for the files backend is somehow skipped and because the jwt backend fails, I receive an error.
Or because the jwt backend fails (admin is not a jwt token), the files ACL check is skipped.
mosquitto.conf:
auth_files.acl:
Thank you for this project and I am looking forward to your feedback.
~ Marius
The text was updated successfully, but these errors were encountered: