Skip to content

ConvertTo-PodeJwt

SYNOPSIS

Convert a Header/Payload into a JWT.

SYNTAX

ConvertTo-PodeJwt [-Header] <Hashtable> [-Payload] <Hashtable> [[-Secret] <String>] [<CommonParameters>]

DESCRIPTION

Convert a Header/Payload hashtable into a JWT, with the option to sign it.

EXAMPLES

EXAMPLE 1

ConvertTo-PodeJwt -Header @{ alg = 'none' } -Payload @{ sub = '123'; name = 'John' }

EXAMPLE 2

ConvertTo-PodeJwt -Header @{ alg = 'hs256' } -Payload @{ sub = '123'; name = 'John' } -Secret 'abc'

PARAMETERS

-Header

A Hashtable containing the Header information for the JWT.

Type: Hashtable
Parameter Sets: (All)
Aliases:

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

-Payload

A Hashtable containing the Payload information for the JWT.

Type: Hashtable
Parameter Sets: (All)
Aliases:

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

-Secret

An Optional Secret for signing the JWT. This is mandatory if the Header algorithm isn't "none".

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
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

OUTPUTS

NOTES