Community discussions

MikroTik App
 
michaelNGV
just joined
Topic Author
Posts: 1
Joined: Wed May 03, 2023 8:27 am

REST API with an account secured by a public key

Wed May 03, 2023 8:38 am

I'm trying:
curl -k -u ngvmonitoring: --pass 'passphrase' --key keydir/id_rsa https://routerIPaddress/rest/system/resource
but the response is:
{"error":401,"message":"Unauthorized"}
The account ngvmonitoring has an
ssh
public key but an undefined password. We already use it successfully with the Java
com.jcraft.jschJSch
library where we automate scripted login and command-response sessions, but I'd like to use the REST API if possible. It seems that the REST API works by password authentication only. Is this so?

Who is online

Users browsing this forum: donkeyKong, marcelofares, rogerioqueiroz and 24 guests