dnewsholme / PasswordState-Management

Powershell Module For Management of Passwordstate. (Powershell Core Compatible)
GNU General Public License v3.0
39 stars 14 forks source link

ToPSCredential method will now work with username: username@domain #124

Closed eizedev closed 4 years ago

eizedev commented 4 years ago

If a username in format "user@domain" is specified in the username field in passwordmanager the ToPSCredential() method will generate the wrong username because the method will add "domain\" before the username. Results to: "domain\user@domain" instead of only the username that already includes the domain name.

For some applications the "old" format of domain\username cannot be used. I added the possibility to check if a "@" symbol is found in the username field. If this is the case the username field will be used as it is. If not and the domain is also found in the passwordmanager username field, the format domain\username will be used.

So it doesn't matter in which format the username is entered into the field, ToPSCredential should now work correctly.

image

Note: If password resets are used, the entry in the Username field must not contain the domain, only the username (i.e. not domain\user and also not user@domain). This has however nothing to do with the ToPSCredential method.

dnewsholme commented 4 years ago

Good find and nice solution. Thanks for the pull request.