Hi,
I used the claims example: Security - PowerShell Universal to authenticate domain users in PSU.
$Result = [Security.AuthenticationResult]::new()
if ($Credential.UserName -eq 'Admin')
{
#Maintain the out of box admin user
New-PSUAuthenticationResult -UserName 'Admin' -Success
}
else
{
$CurrentDomain = "LDAP://DC=mydemodomain,DC=com"
...
After the authentication.ps1 code update I can authenticate AD users, but I can also login with the admin account using any password.
Is there a way to prevent this without matching the password like this in plain text?
if ($Credential.UserName -eq 'Admin' -and $Credential.GetNetworkCredential().Password -eq 'MySuperSecretPassword')
{
New-PSUAuthenticationResult -Success -UserName 'Admin'
}
Product: PowerShell Universal
Version: 3.9.15