New-PSUAuthorizationClaim
Creates a new authorization claim.
SYNOPSIS
SYNTAX
New-PSUAuthorizationClaim -Type <String> -Value <String> [-ValueType <String>] [-Properties <Hashtable>]
[-Issuer <String>] [<CommonParameters>]DESCRIPTION
EXAMPLES
Example 1
Set-PSUAuthenticationMethod -ScriptBlock {
param([PSCredential]$Credential)
if ($Credential.UserName -eq 'admin')
{
New-PSUAuthenticationResult -Success -UserName 'admin' -Claims {
New-PSUAuthorizationClaim -Type 'MyRole' -Value 'MyValue' -ValueType 'String' -Issuer 'Something'
}
}
else
{
New-PSUAuthenticationResult -ErrorMessage 'Hello'
}
}
New-PSURole -Name 'CustomRole' -Policy {
param($User)
$User.HasClaim("MyRole", "MyValue")
}PARAMETERS
-Issuer
-Properties
-Type
-Value
-ValueType
CommonParameters
INPUTS
None
OUTPUTS
System.Object
NOTES
RELATED LINKS
Last updated
Was this helpful?