Closed it-praktyk closed 6 years ago
Other options that can be used
On Windows we use the secure string feature inside of the PowerShell language to serialize the GitLab token to disk. The token can only be de-serialized by the user that created the token.
I have not been able to find any examples of people using the Credential store to get credentials with PowerShell. The example given serializes to disk like Save-GitLabAPIConfiguration currently does.
The Mac and Linux side of the equation is obviously a problem. I'd like to see first-party support as requested in https://github.com/PowerShell/PowerShell/issues/1654. I will look into Protect-CMSMessage for *unix users but I don't believe it would work outside of an enterprise CA env.
Please correct me if my understanding of the technology is wrong.
As this would be Windows only I don't believe this would be worth the effort. Smarter developers than I would likely have to solve a x-plat solution.
Currently the function
Save-GitLabAPIConfiguration
store data in the file "$env:appdata\PSGitLab\PSGitLabConfiguration.xml".I think that better option is to use built-in in Windows credential manager.
Possible Solution https://practical365.com/blog/saving-credentials-for-office-365-powershell-scripts-and-scheduled-tasks/
But it will work only for Windows and (probably) PowerShell 5.x.