You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That way, a client that's always running can always renew their ticket with the previous one and does not have to re-authorize.
However, I was unable to get this to work in go-proxmox; is this feature not supported yet?
If I call the Client.Ticket() function, it expects a "Credential" object. If I set that to "nil", I get the following error:
bad request: 400 Parameter verification failed. - {"password":"property is missing and it is not optional","username":"property is missing and it is not optional"}
If I instead set credential to a Credential object with just the "username" property, I get "not authorized to access endpoint".
If I try to build the "full" API request as explained in that forum post (username, realm, password), that doesn't work because to extend a Ticket you need to pass the previous Ticket as the password value, and as the Client has no method like "GetCurrentTicket", I'm unable to do that. (Or is there a way to extract / get access to the current ticket that I'm missing?)
Right now I'm just building a whole new Credentials object as a workaround, including Realm, Username and Password - that works, but it's ugly because it means A) I need to store the user password to re-authenticate every two hours, and B) it doesn't work with OTP since the user's original OTP from the initial login has already expired.
I'm probably making some stupid mistake as I haven't used Go very much in the past - is there example code somewhere on how to renew a Ticket without re-authenticating using a Password/Token/2FA, just by using the previous Ticket, to keep the session active? Or is that just not supported by this client yet?
The text was updated successfully, but these errors were encountered:
According to the following post on the Proxmox forums, the API supports renewing a Ticket with just the previous ticket: https://forum.proxmox.com/threads/api-how-to-get-new-ticket.19034/
That way, a client that's always running can always renew their ticket with the previous one and does not have to re-authorize.
However, I was unable to get this to work in go-proxmox; is this feature not supported yet?
If I call the Client.Ticket() function, it expects a "Credential" object. If I set that to "nil", I get the following error:
If I instead set credential to a Credential object with just the "username" property, I get "not authorized to access endpoint".
If I try to build the "full" API request as explained in that forum post (username, realm, password), that doesn't work because to extend a Ticket you need to pass the previous Ticket as the password value, and as the Client has no method like "GetCurrentTicket", I'm unable to do that. (Or is there a way to extract / get access to the current ticket that I'm missing?)
Right now I'm just building a whole new Credentials object as a workaround, including Realm, Username and Password - that works, but it's ugly because it means A) I need to store the user password to re-authenticate every two hours, and B) it doesn't work with OTP since the user's original OTP from the initial login has already expired.
I'm probably making some stupid mistake as I haven't used Go very much in the past - is there example code somewhere on how to renew a Ticket without re-authenticating using a Password/Token/2FA, just by using the previous Ticket, to keep the session active? Or is that just not supported by this client yet?
The text was updated successfully, but these errors were encountered: