I am creating an API to do the OTP verification for a user with 2FA since there is no api for use in curl. I have the code but without the flow between the login and the OTP I cannot continue.
I have the user with 2FA activated, I log in using api rest client
I get a token and I use it to consult
{“path”: “ns.ovpnrw”, “method”: “list-users”, “payload”: {“instance”: “ns_roadwarrior1”}}
But it returns me, I know it’s because of the lack of validation of the otp
{
“code”: 403,
“data”: null,
“message”: “you don’t have permission to access this resource”
}
I think there must be a record that validates and generates a different token or when validating otp it is given permissions to use the APIs, (I inquire)
In each token it tells me if 2FA is activated or not but I don’t know if I’m missing something
{
"2fa": true,
"actions": [],
"exp": 1763601616,
"id": "User2FA",
"orig_iat": 1763515216,
"role": ""
}