New PodeAuthScheme - mdaneri/Pode GitHub Wiki
external help file: Pode-help.xml Module Name: Pode online version: PodeType: Authentication schema: 2.0.0
Create a new type of Authentication scheme.
New-PodeAuthScheme [-Basic] [-Encoding <String>] [-HeaderTag <String>] [-Description <String>]
[-Realm <String>] [-Middleware <Object[]>] [-InnerScheme <Hashtable>] [-AsCredential]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeAuthScheme [-HeaderTag <String>] [-Description <String>] [-Realm <String>] [-Middleware <Object[]>]
[-Digest] [-InnerScheme <Hashtable>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeAuthScheme [-HeaderTag <String>] [-Description <String>] [-Realm <String>] [-Middleware <Object[]>]
[-Bearer] [-Scope <String[]>] [-InnerScheme <Hashtable>] [-AsJWT] [-Secret <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeAuthScheme [-Form] [-UsernameField <String>] [-PasswordField <String>] [-Description <String>]
[-Realm <String>] [-Middleware <Object[]>] [-InnerScheme <Hashtable>] [-AsCredential]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeAuthScheme [-Custom] -ScriptBlock <ScriptBlock> [-ArgumentList <Hashtable>] [-Name <String>]
[-Description <String>] [-Realm <String>] [-Type <String>] [-Middleware <Object[]>]
[-PostValidator <ScriptBlock>] [-InnerScheme <Hashtable>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
New-PodeAuthScheme [-Description <String>] [-Realm <String>] [-Middleware <Object[]>] [-ApiKey]
[-Location <String>] [-LocationName <String>] [-InnerScheme <Hashtable>] [-AsJWT] [-Secret <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeAuthScheme [-Description <String>] [-Realm <String>] [-Middleware <Object[]>] -ClientId <String>
[-ClientSecret <String>] [-RedirectUrl <String>] [-AuthoriseUrl <String>] -TokenUrl <String>
[-UserUrl <String>] [-UserUrlMethod <String>] [-CodeChallengeMethod <String>] [-UsePKCE] [-OAuth2]
[-Scope <String[]>] [-InnerScheme <Hashtable>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeAuthScheme [-Description <String>] [-Realm <String>] [-Middleware <Object[]>] [-ClientCertificate]
[-InnerScheme <Hashtable>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeAuthScheme [-Description <String>] [-Middleware <Object[]>] [-InnerScheme <Hashtable>] [-Negotiate]
-KeytabPath <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
Create a new type of Authentication scheme, which is used to parse the Request for user credentials for validating.
$basic_auth = New-PodeAuthScheme -Basic
$form_auth = New-PodeAuthScheme -Form -UsernameField 'Email'
$custom_auth = New-PodeAuthScheme -Custom -ScriptBlock { /* logic */ }
If supplied, will use the inbuilt API key Authentication scheme.
Type: SwitchParameter
Parameter Sets: ApiKey
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseAn array of arguments to supply to the Custom Authentication type's ScriptBlock.
Type: Hashtable
Parameter Sets: Custom
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, username/password credentials for Basic/Form authentication will instead be supplied as a pscredential object.
Type: SwitchParameter
Parameter Sets: Basic, Form
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the token/key supplied for Bearer/API key authentication will be parsed as a JWT, and the payload supplied instead.
Type: SwitchParameter
Parameter Sets: Bearer, ApiKey
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe OAuth2 Authorisation URL to authenticate a User. This is optional if you're using an InnerScheme like Basic/Form.
Type: String
Parameter Sets: OAuth2
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, will use the inbuilt Basic Authentication credentials retriever.
Type: SwitchParameter
Parameter Sets: Basic
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, will use the inbuilt Bearer Authentication token retriever.
Type: SwitchParameter
Parameter Sets: Bearer
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, will use the inbuilt Client Certificate Authentication scheme.
Type: SwitchParameter
Parameter Sets: ClientCertificate
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe Application ID generated when registering a new app for OAuth2.
Type: String
Parameter Sets: OAuth2
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe Application Secret generated when registering a new app for OAuth2 (this is optional when using PKCE).
Type: String
Parameter Sets: OAuth2
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn optional method for sending a PKCE code challenge when calling the Authorise URL - for OAuth2 (Default: S256)
Type: String
Parameter Sets: OAuth2
Aliases:
Required: False
Position: Named
Default value: S256
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, will allow you to create a Custom Authentication credentials retriever.
Type: SwitchParameter
Parameter Sets: Custom
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseA short description for security scheme. CommonMark syntax MAY be used for rich text representation
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, will use the inbuilt Digest Authentication credentials retriever.
Type: SwitchParameter
Parameter Sets: Digest
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe Encoding to use when decoding the Basic Authorization header.
Type: String
Parameter Sets: Basic
Aliases:
Required: False
Position: Named
Default value: ISO-8859-1
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, will use the inbuilt Form Authentication credentials retriever.
Type: SwitchParameter
Parameter Sets: Form
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe Tag name used in the Authorization header, ie: Basic, Bearer, Digest.
Type: String
Parameter Sets: Basic, Digest, Bearer
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn optional authentication Scheme (from New-PodeAuthScheme) that will be called prior to this Scheme.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseThe path to the Keytab file for Negotiate authentication.
Type: String
Parameter Sets: Negotiate
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe Location to find an API key: Header, Query, or Cookie. (Default: Header)
Type: String
Parameter Sets: ApiKey
Aliases:
Required: False
Position: Named
Default value: Header
Accept pipeline input: False
Accept wildcard characters: FalseThe Name of the Header, Query, or Cookie to find an API key. (Default depends on Location. Header/Cookie: X-API-KEY, Query: api_key)
Type: String
Parameter Sets: ApiKey
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn array of ScriptBlocks for optional Middleware to run before the Scheme's scriptblock.
Type: Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe Name of an Authentication type - such as Basic or NTLM.
Type: String
Parameter Sets: Custom
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, will use the inbuilt Negotiate Authentication scheme (Kerberos/NTLM).
Type: SwitchParameter
Parameter Sets: Negotiate
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, will use the inbuilt OAuth2 Authentication scheme.
Type: SwitchParameter
Parameter Sets: OAuth2
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe name of the Password Field in the payload to retrieve the password.
Type: String
Parameter Sets: Form
Aliases:
Required: False
Position: Named
Default value: Password
Accept pipeline input: False
Accept wildcard characters: FalseThe PostValidator is a scriptblock that is invoked after user validation.
Type: ScriptBlock
Parameter Sets: Custom
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe name of scope of the protected area.
Type: String
Parameter Sets: Basic, Digest, Bearer, Form, Custom, ApiKey, OAuth2, ClientCertificate
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn optional OAuth2 Redirect URL (default: <host>/oauth2/callback)
Type: String
Parameter Sets: OAuth2
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn optional array of Scopes for Bearer/OAuth2 Authentication. (These are case-sensitive)
Type: String[]
Parameter Sets: Bearer, OAuth2
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe ScriptBlock is used to parse the request and retieve user credentials and other information.
Type: ScriptBlock
Parameter Sets: Custom
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn optional Secret, used to sign/verify JWT signatures.
Type: String
Parameter Sets: Bearer, ApiKey
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe OAuth2 Token URL to acquire an access token.
Type: String
Parameter Sets: OAuth2
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe scheme type for custom Authentication types. Default is HTTP.
Type: String
Parameter Sets: Custom
Aliases:
Required: False
Position: Named
Default value: Http
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, OAuth2 authentication will use PKCE code verifiers - for OAuth2
Type: SwitchParameter
Parameter Sets: OAuth2
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe name of the Username Field in the payload to retrieve the username.
Type: String
Parameter Sets: Form
Aliases:
Required: False
Position: Named
Default value: Username
Accept pipeline input: False
Accept wildcard characters: FalseAn optional User profile URL to retrieve a user's details - for OAuth2
Type: String
Parameter Sets: OAuth2
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn optional HTTP method to use when calling the User profile URL - for OAuth2 (Default: Post)
Type: String
Parameter Sets: OAuth2
Aliases:
Required: False
Position: Named
Default value: Post
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.