Skip to content

Improve how the $password is converted to plain text#9

Merged
brentkeller merged 1 commit intomainfrom
hotfix-password-parsing
Jan 5, 2024
Merged

Improve how the $password is converted to plain text#9
brentkeller merged 1 commit intomainfrom
hotfix-password-parsing

Conversation

@brentkeller
Copy link
Member

@brentkeller brentkeller commented Dec 19, 2023

Solves

FD: https://helpdesk.devresults.com/a/tickets/9494

A client reported getting the following error: 401: An error occurred when logging in

This turned out to be a "wrong password" response coming from the server because the $password parameter was not properly being converted back to a plain text string on non-Window environments.

Description

It seems that the previous technique was only returning the first character when running the script from on non-Windows environments. I've replaced our previous conversion of $password with ConvertFrom-SecureString, which seems to work properly.

Testing

  1. Create an instance export manifest
  2. Run InstanceExport.ps1 with the manifest and verify that the login still works (on Windows and/or another OS)

This previous technique was only returning the first character when running the script from on non-Windows environments
@brentkeller brentkeller added the tech/powershell Changes were made using powershell script language label Dec 19, 2023
@fredrodlima
Copy link
Contributor

I'm going to review this tomorrow

Copy link
Contributor

@fredrodlima fredrodlima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good. I was able to login successfully using the manifest and my account for triggering an instance export. Sorry for missing this review since I came back BK! Nice work on fixing this for us!

@brentkeller brentkeller merged commit aef90ec into main Jan 5, 2024
@brentkeller brentkeller deleted the hotfix-password-parsing branch January 5, 2024 17:16
@bigdogwillfeed
Copy link
Member

FYI: this change is only supported in Powershell 7+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS tech/powershell Changes were made using powershell script language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants