Error while retreiving tokens

Error while retreiving tokens

avatar

Hi,
I am using my domain id to authenticate to the Devolutions Server. I have tried my domain id with and without the domain name. No matter what I do I receive this message. I can authenticate as an application, that works ok. Can someone help me with this issue?


New-DSSession: [New-DSSession] There was a problem reaching your DVLS instance. Either you provided a wrong URL or it's not pointing to a DVLS instance.
Exception: C:\Windows\System32\WindowsPowerShell\v1.0\Modules\Devolutions.Server\Private\OAuth (WIP)\Request-DSOAuthAccessToken.ps1:25
Line |
25 | throw 'Error while retreiving tokens.'
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Error while retreiving tokens.

All Comments (4)

avatar

Hello,

Normally, your browser should open, since you would need to input your password in the browser for the OAuth. Can you confirm this is the case? The preferred method is with the application key, this way you can automate the whole process.

Also, please make sure you use the same version as the PS module as your version of Devolutions Server. For example, if you have Devolutions Server 2022.2, you need to use the 2022.2 release of the module. You can view the previous versions here: https://www.powershellgallery.com/packages/Devolutions.server/

Best regards,

Richard Boisvert

avatar

Thanks Richard, I will use the application auth.
How do I give permissions to the Vaults to that application? I have given it access to a Vault, but do I have to do anything else?

Also, I am receiving this error message when connection as the application, but the status code is 200 and isSuccess is True.
7 | New-DSSession $Credential $DS_URL -AsApplication
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| [New-DSSession] There was a problem reaching your DVLS instance. Either you provided a wrong URL or it's not pointing to a DVLS instance.

I do have to upgrade Devolutions as you suggested.
Thanks!
Jen

avatar

Hello Jen,

In older versions, there were issue with the application, you sometimes had to add it to a custom group that had admin rights. Normally to grant access to a vault, you simply need to go in the properties of the application and grant it access to that vault, or to a custom user group that has access to the vault.

For the error, make sure the URL does not have a slash (/) at the end, but since it returns a 200, you should still be connected.

Best regards,

Richard Boisvert

avatar

Thanks, adding the Application to a role and giving permissions to the role was required.