-
Notifications
You must be signed in to change notification settings - Fork 21
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 access token authentication #1
Comments
Hi, @itviewer, thanks for the feedback! Unfortunetly using the However I am planning on implementing other authentication mechanisms, such as tokens (provided by a HTTP header) and UNIX sockets with permissions. The MVP only ended up having mTLS as this met my initial use case. It shoudln't be long before this is implemented. I hope this was helpful. 🙂 |
Thanks, it sounds exciting. |
Discussing this issue in #2 |
Fixed by #5 |
placing an authenticating reverse proxy or using mTLS is annoying
the json-rpc request object has an id member, can we use this parameter to pass the authentication token?
the server:
wg-api --device=<my device> --listen=localhost:1234 --token=abcdef
then the request:
curl http://localhost:8080 -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "GetDeviceInfo", "params": {}, "id":"abcdef"}'
The server performs Token authentication on each request from the client. If it does not match, it just returns an error and without performing any operation.
the argument --token is optional
The text was updated successfully, but these errors were encountered: