Get-HtmlBrowserSsoHandoff
August 3, 2026 ยท View on GitHub
SYNOPSIS
Gets SAML, WS-Federation, OAuth, or OpenID Connect form and URL callback handoffs from the current browser page.
SYNTAX
Session
Get-HtmlBrowserSsoHandoff [[-Session] <HtmlBrowserSession>] [-IncludeSensitiveValues] [-Analyze] [-IncludeXml] [-IncludeJson] [-IncludeAllForms] [-MaxValueLength <int>] [-Wait] [-Timeout <int>] [-PollMilliseconds <int>] [-CancellationToken <CancellationToken>] [<CommonParameters>]
Url
Get-HtmlBrowserSsoHandoff [-Url] <string> [-Browser <HtmlBrowserEngine>] [-ProfilePath <string>] [-Scenario <HtmlBrowserScenario>] [-UserDataDirectory <string>] [-StatePath <string>] [-BrowserChannel <string>] [-Clean] [-Proxy <string>] [-ProxyCredential <pscredential>] [-Visible] [-SlowMo <int>] [-NavigationTimeout <int>] [-LoadState <HtmlBrowserLoadState>] [-BlockResourceType <HtmlNetworkResourceType[]>] [-BlockResourcePattern <string[]>] [-IncludeSensitiveValues] [-Analyze] [-IncludeXml] [-IncludeJson] [-IncludeAllForms] [-MaxValueLength <int>] [-Wait] [-Timeout <int>] [-PollMilliseconds <int>] [-CancellationToken <CancellationToken>] [<CommonParameters>]
File
Get-HtmlBrowserSsoHandoff [-Path] <string> [-Browser <HtmlBrowserEngine>] [-ProfilePath <string>] [-Scenario <HtmlBrowserScenario>] [-UserDataDirectory <string>] [-StatePath <string>] [-BrowserChannel <string>] [-Clean] [-Proxy <string>] [-ProxyCredential <pscredential>] [-Visible] [-SlowMo <int>] [-NavigationTimeout <int>] [-LoadState <HtmlBrowserLoadState>] [-BlockResourceType <HtmlNetworkResourceType[]>] [-BlockResourcePattern <string[]>] [-IncludeSensitiveValues] [-Analyze] [-IncludeXml] [-IncludeJson] [-IncludeAllForms] [-MaxValueLength <int>] [-Wait] [-Timeout <int>] [-PollMilliseconds <int>] [-CancellationToken <CancellationToken>] [<CommonParameters>]
DESCRIPTION
Gets SAML, WS-Federation, OAuth, or OpenID Connect form and URL callback handoffs from the current browser page.
EXAMPLES
EXAMPLE 1
$session = Start-HtmlBrowserSession -Url https://portal.contoso.example -Visible -ManualLogin -PreventSsoAutoSubmit
$handoff = Get-HtmlBrowserSsoHandoff -Session $session -Wait -Timeout 60000
$handoff | Select-Object Kind, Action, FormData, SuggestedCommand, Warnings
$analysis = Get-HtmlBrowserSsoHandoff -Session $session -Analyze
$analysis | Select-Object Kind, Action, FieldNames, SamlResponse, JsonWebTokens, Warnings
# Only reveal assertion values when you intentionally need to replay the handoff.
$handoff = Get-HtmlBrowserSsoHandoff -Session $session -IncludeSensitiveValues
$webSession = ConvertTo-HtmlWebRequestSession -Session $session
Invoke-WebRequest -Uri $handoff.Action -Method $handoff.Method -Body $handoff.FormData -WebSession $webSession
PARAMETERS
-Analyze
Return safe SAML, OAuth, or OpenID Connect protocol analysis instead of raw handoff form data.
Type: SwitchParameter
Parameter Sets: Session, Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-BlockResourcePattern
Playwright URL glob patterns to abort before navigation, such as /analytics/.
Type: String[]
Parameter Sets: Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-BlockResourceType
Browser resource types to abort before navigation, such as Image, Media, Font, or Stylesheet.
Type: HtmlNetworkResourceType[]
Parameter Sets: Url, File
Aliases: None
Possible values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, Other
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Browser
Browser engine to use when loading Url or Path.
Type: HtmlBrowserEngine
Parameter Sets: Url, File
Aliases: None
Possible values: Chromium, Firefox, WebKit
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-BrowserChannel
Browser distribution channel, such as chrome, msedge, chromium, chrome-beta, or msedge-dev.
Type: String
Parameter Sets: Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-CancellationToken
Token used to cancel the operation.
Type: CancellationToken
Parameter Sets: Session, Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Clean
Reinstall browser runtimes when using Url or Path.
Type: SwitchParameter
Parameter Sets: Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IncludeAllForms
Return all forms, not only forms with recognizable SSO handoff fields. URL callbacks still require recognizable protocol fields.
Type: SwitchParameter
Parameter Sets: Session, Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IncludeJson
Include decoded JWT header and payload JSON in analysis output. Sensitive payload values remain redacted unless IncludeSensitiveValues is also set.
Type: SwitchParameter
Parameter Sets: Session, Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IncludeSensitiveValues
Include sensitive assertion, token, and state values. By default those values are redacted.
Type: SwitchParameter
Parameter Sets: Session, Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IncludeXml
Include decoded SAML XML in analysis output. Sensitive XML values remain redacted unless IncludeSensitiveValues is also set.
Type: SwitchParameter
Parameter Sets: Session, Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-LoadState
Initial browser navigation readiness state.
Type: HtmlBrowserLoadState
Parameter Sets: Url, File
Aliases: None
Possible values: Commit, DomContentLoaded, Load, NetworkIdle
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MaxValueLength
Maximum field value length to return. Zero disables truncation.
Type: Int32
Parameter Sets: Session, Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-NavigationTimeout
Timeout in milliseconds for the initial browser navigation when using Url or Path.
Type: Int32
Parameter Sets: Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Path
Path to a local HTML file containing an SSO handoff page.
Type: String
Parameter Sets: File
Aliases: File
Possible values:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-PollMilliseconds
Polling interval in milliseconds while waiting for a handoff form.
Type: Int32
Parameter Sets: Session, Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProfilePath
Optional browser profile JSON file used as launch defaults.
Type: String
Parameter Sets: Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Proxy
Proxy server address used when launching the browser.
Type: String
Parameter Sets: Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProxyCredential
Credentials used for the Proxy server.
Type: PSCredential
Parameter Sets: Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Scenario
Intent-focused browser automation defaults to apply before explicit parameter values.
Type: HtmlBrowserScenario
Parameter Sets: Url, File
Aliases: None
Possible values: Custom, AuditProof, MailboxProof, LoginProtected, SinglePageApp, LowBandwidth, NetworkCapture, DownloadEvidence
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Session
Existing browser session. When omitted, the default PSParseHTML session is used.
Type: HtmlBrowserSession
Parameter Sets: Session
Aliases: None
Possible values:
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-SlowMo
Slow down Playwright actions by the specified milliseconds.
Type: Int32
Parameter Sets: Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-StatePath
Playwright storage-state JSON file for cookies and local storage.
Type: String
Parameter Sets: Url, File
Aliases: StorageStatePath
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Timeout
Maximum time in milliseconds to wait when Wait is used. Zero waits indefinitely.
Type: Int32
Parameter Sets: Session, Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Url
URL of the SSO-protected page or handoff page to inspect.
Type: String
Parameter Sets: Url
Aliases: None
Possible values:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-UserDataDirectory
Persistent browser user-data directory for cookies, storage, cache, and permissions.
Type: String
Parameter Sets: Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Visible
Show the browser instead of running headless.
Type: SwitchParameter
Parameter Sets: Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Wait
Wait until at least one matching SSO handoff form or URL callback is observed.
Type: SwitchParameter
Parameter Sets: Session, Url, File
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
HtmlTinkerX.HtmlBrowserSession
OUTPUTS
HtmlTinkerX.HtmlBrowserSsoHandoffHtmlTinkerX.HtmlSsoHandoffAnalysis
RELATED LINKS
- None