-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add token authentication #16
Conversation
liorfranko
commented
Sep 24, 2024
- Add option to authenticate using token - https://www.ntop.org/guides/ntopng/advanced_features/authentication.html?highlight=token#token-based-authentication
- Read the token from env variable.
- Validate that if trying to authenticate with either cookie/basic/token and the needed variables (user/password or token) was not set, an error will be printed.
Tests:
Choosing cookie without setting user/password - fail the validation
Adding user/password - pass the validation, but fail authenticating (I don't have the correct user/password)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together @liorfranko! I think that this will be helpful for users of the project!
I had one minor nit on the validate function.
Additionally, I think it would be good to update the comment string https://github.com/aauren/ntopng-exporter/blob/main/config/ntopng-exporter.yaml#L6
And to also have a commented out token:
field in the config as well so that people know how to configure token authentication.
Sure! |