< Back
Enable-PodeCsrfMiddleware
Post
NAME Enable-PodeCsrfMiddleware
SYNOPSIS
Enables Middleware for verifying CSRF tokens on Requests.
SYNTAX
Enable-PodeCsrfMiddleware [-IgnoreMethods <String[]>] [-Secret <String>] [-UseCookies] [<CommonParameters>]
DESCRIPTION
Enables Middleware for verifying CSRF tokens on Requests, with configurable HTTP methods to ignore verification.
PARAMETERS
-IgnoreMethods <String[]>
An array of HTTP methods to ignore CSRF verification.
Required? false
Position? named
Default value @('Get', 'Head', 'Options', 'Trace')
Accept pipeline input? false
Accept wildcard characters? false
-Secret <String>
A secret to use when signing cookies - for when using CSRF with cookies.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-UseCookies [<SwitchParameter>]
If supplied, CSRF will used cookies rather than sessions.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Enable-PodeCsrfMiddleware -IgnoreMethods @('Get', 'Trace')
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Enable-PodeCsrfMiddleware -Secret 'some-secret' -UseCookies
RELATED LINKS
SYNOPSIS
Enables Middleware for verifying CSRF tokens on Requests.
SYNTAX
Enable-PodeCsrfMiddleware [-IgnoreMethods <String[]>] [-Secret <String>] [-UseCookies] [<CommonParameters>]
DESCRIPTION
Enables Middleware for verifying CSRF tokens on Requests, with configurable HTTP methods to ignore verification.
PARAMETERS
-IgnoreMethods <String[]>
An array of HTTP methods to ignore CSRF verification.
Required? false
Position? named
Default value @('Get', 'Head', 'Options', 'Trace')
Accept pipeline input? false
Accept wildcard characters? false
-Secret <String>
A secret to use when signing cookies - for when using CSRF with cookies.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-UseCookies [<SwitchParameter>]
If supplied, CSRF will used cookies rather than sessions.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Enable-PodeCsrfMiddleware -IgnoreMethods @('Get', 'Trace')
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Enable-PodeCsrfMiddleware -Secret 'some-secret' -UseCookies
RELATED LINKS