For the complete documentation index, see llms.txt. This page is also available as Markdown.

Set-PSUAuthenticationMethod

Sets the authentication method settings.

SYNOPSIS

Sets the authentication method settings.

SYNTAX

Type (Default)

Set-PSUAuthenticationMethod [-ScriptBlock <ScriptBlock>] [-Type <AuthenticationMethodType>] [-Disabled]
 [-Configure <ScriptBlock>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]

SAML2

Set-PSUAuthenticationMethod [-ScriptBlock <ScriptBlock>] [-Type <AuthenticationMethodType>] [-Disabled]
 -CallbackPath <String> [-MetadataAddress <String>] [-SigningKey <String>] [-EntityId <String>]
 [-IdentityProviderEntityId <String>] [-ServiceCertificate <String>] [-SingleSignOnServiceUrl <String>]
 [-Configure <ScriptBlock>] [-AllowUnsolicitedAuthnResponse] [-NameIdPolicy <String>] [-LoadMetadata]
 [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials]
 [-Integrated] [-TrustCertificate] [-Cookies] [<CommonParameters>]

OIDC

WSFed

LogoutUrl

Form

Domain

DESCRIPTION

Sets the authentication method settings.

Authentication settings are stored in .universal/authentication.ps1

You can also use this cmdlet with the PowerShell Universal Management API.

EXAMPLES

Example 1

Forms authentication script blocks receive a single $Credential parameter that contains a PSCredential object. You need to return a New-PSUAuthenticationResult from the script block to grant and deny access.

PARAMETERS

-AppToken

The AppToken that is used for calling the PowerShell Universal Management API. You can also call Connect-PSUServer before calling this cmdlet to set the AppToken for the entire session.

-ComputerName

Specifies the computer name or URL that should be called when accessing the PowerShell Universal Management API. You can also use Connect-PSUServer before calling this cmdlet to set the computer name for the entire session.

-ScriptBlock

The script block to execute when a user is logging in.

-Disabled

Whether forms authentication is disabled.

-UseDefaultCredentials

Use default credentials when connecting to the management API

-Authority

The OpenID Connect authority URL.

-CallbackPath

The callback path the authority will call after authentication.

-ClientId

The OpenID Connect Client ID to supply the authority with.

-ClientSecret

The OpenID Connect Client Secret to supply the authority with.

-Configure

Additional configuration script that can be run to update the authentication provider settings. See our online documentation for more information.

-CorrelationCookieSameSite

The CorrelationCookieSameSite setting to use for OpenID Conenct or WS-Federation authentication.

-EntityId

The entity ID for SAML2 authentication.

-GetClaimsFromUserInfoEndpoint

Whether to return additional claims information from the OpenID Connect authority. This setting is not supported by all authorities.

-IdentityProviderEntityId

The Idetity Provider Entity ID for SAML2 authentication. This is usually the URL to call for authentication.

-Integrated

Executes the command internally rather than using the Management API. Only works when running script from within PowerShell Universal.

-MetadataAddress

The SAML2 or WS-Federation metadata address. For SAML2, this should be specified if it is different than the Identity Provider Entity ID. For WS-Federation, this setting is required.

-Resource

A resource to grant a token for when authenticating with OpenID Connect.

-ResponseType

The OpenID Connect response type. This can be token or code.

-SaveTokens

Whether to save the tokens within the OpenID Connect cookie.

-Scopes

Scopes to request during OpenID Connect authentication.

-ServiceCertificate

The service certificate to use when authenticating against the SAML2 Identity Provider.

-Type

The Authentication Method Type.

-UseTokenLifetime

Whether to use the token lifetime as the cookie lifetime.

-Wreply

The WS-Federation Wreply setting.

-Wtrealm

The WS-Federation Wrealm setting.

-RequireMfa

Enforce the MFA requirement for OpenID Connect.

-SigningKey

A certificate signing key to use with SAML2.

-SingleSignOnServiceUrl

The single signon service URL for SAML2.

-LogoutUrl

The logout URL for OpenAPI Connect or WS-Federation.

-AllowUnsolicitedAuthnResponse

Allow unsolicited authentication responses for SAML2.

-Credential

Credentials to login to the PowerShell Universal Management API.

-TrustCertificate

Whether the cmdlet should ignore certificate issues.

-LoadMetadata

Whether to load metadata for SAML2 authentication.

-NameIdPolicy

The SAML2 Name ID policy.

-Domain

The domain to login when using native authentication.

-Native

Forms authentication will use the native operating system for login. Currently, only supported on Windows.

-Cookies

Reuses and persists authentication cookies for the current PowerShell session.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES

Last updated

Was this helpful?