Skip to content

Add-PodeAuth

SYNOPSIS

Adds a custom Authentication method for verifying users.

SYNTAX

Add-PodeAuth [-Name] <String> [-Scheme] <Hashtable> [-ScriptBlock] <ScriptBlock> [[-ArgumentList] <Object[]>]
 [[-FailureUrl] <String>] [[-FailureMessage] <String>] [[-SuccessUrl] <String>] [-Sessionless]
 [-SuccessUseOrigin] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Adds a custom Authentication method for verifying users.

EXAMPLES

EXAMPLE 1

New-PodeAuthScheme -Form | Add-PodeAuth -Name 'Main' -ScriptBlock { /* logic */ }

PARAMETERS

-ArgumentList

An array of arguments to supply to the Custom Authentication's ScriptBlock.

Type: Object[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-FailureMessage

An override Message to throw when authentication fails.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-FailureUrl

The URL to redirect to when authentication fails.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Name

A unique Name for the Authentication method.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Scheme

The authentication Scheme to use for retrieving credentials (From New-PodeAuthScheme).

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ScriptBlock

The ScriptBlock defining logic that retrieves and verifys a user.

Type: ScriptBlock
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Sessionless

If supplied, authenticated users will not be stored in sessions, and sessions will not be used.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-SuccessUrl

The URL to redirect to when authentication succeeds when logging in.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SuccessUseOrigin

If supplied, successful authentication from a login page will redirect back to the originating page instead of the FailureUrl.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
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

OUTPUTS

NOTES