First:
Yes I know there is a powershell module.
Yes, the python SDK is deprecated.
Yes I know there is the CLI.
But:
For a special project I have to use Python to access the devolutions server REST API and I cant even get past authentication.
I tried to reverse the powershell code but I lack the necessary knowledge of encryption to understand fully what is going on.
From what I understand,, the PublicKey is grabbed from /api/server-information.
A 32 Byte Session Key is generated and encrypted with RSA with this PublicKey.
Finally the Application Secret is encrypted with AES CBC using the 32 Byte Session Key.
Both are then supplied via REST as hex-strings to the server.
But I always end up getting "InvalidUserNameOrPasswordPleaseVerifyYourCredentials".
(Same credentials work with PowerShell)
Has anyone got authentication working with python? I would reverse the python SDK but it disappeared from github.
Hello,
Unfortunately, we no longer support the Python module since there were no traction from the user base. If you wish to go down that route, you will need to verify how it is done in the PowerShell module.
The session key authentication will soon be removed from the module, so that solution will be short lived. Only the authentication with the OAuth workflow will be supported (requires Devolutions Server 2022.1+) going forward.
You can refer to New-DSSessionOAuth: https://github.com/Devolutions/devolutions-server/blob/main/Powershell%20Module/Devolutions.Server/Public/OAuth%20(WIP)/New-DSSessionOAuth.ps1 as well as those private cmdlets: https://github.com/Devolutions/devolutions-server/tree/main/Powershell%20Module/Devolutions.Server/Private/OAuth%20(WIP) to see how it is done.
Our apologies for not being able to provide a Python sample.
Best regards,
Richard Boisvert
Well OAuth makes this way easier.
I did not know that this was a possibility.
Thank you very much!