-
|
Hello! I am working on a leafnode architecture where I have an auth callout service that assigns permissions to individual leafnodes identified by an The auth callout service on the remote looks up a device id corresponding to the incoming public key in a database and returns JWT claims giving the leafnode permission to publish on e.g. I observe that the auth callout service receives an object like this from NATS as part of the request claim: {
"nats": {
"user_nkey": "UAO2CCMU37WL6VQGKZ6DRH52BCCUT7OWDBSTUIOT5W2KUI26YFSAPFNL",
"connect_opts": {
"nkey": "UDLY54Z6KSQXIP7SL4DICDB54FPYLX32NKZEIL5LDV3BUX327XTB4BLV",
"lang": "nats.ws",
"version": "3.2.0",
"protocol": 1
},
"type": "authorization_request",
"version": 2
}
}My question is: for |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
@evrys some questions:
IMHO you need to have the client give you want you want to auth on, don't depend on the server for that. Also - callout doesn't do any kind of challenge response, you evaluate on what you got from the client, if you don't like it you reject, otherwise you issue a JWT for them - which is never given to them. |
Beta Was this translation helpful? Give feedback.
-
|
@evrys you should take a look at https://github.com/synadia-io/callout.go, there are many checks that you should implement on your callout - the better suggestion is not to roll your own framework, but rather focus on the generation of your user jwt once you verified the data given by the client. The implementation above is hardened, take a look at it. |
Beta Was this translation helpful? Give feedback.
@evrys some questions:
IMHO you need to have the client give you want you want to auth on, don't depend on the server for that.
Also - callout doesn't do any kind of challenge response, you evaluate on what you got from the client, if you don't like it you reject, otherwise you issue a JWT for them - which is never given to them.