Skip to content

ConvertTo-PodeJwt

SYNOPSIS

Convert a Header/Payload into a JWT.

SYNTAX

ConvertTo-PodeJwt [-Header] <Hashtable> [-Payload] <Hashtable> [[-Secret] <Object>]
 [-ProgressAction <ActionPreference>] [<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

-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

-Secret

An Optional Secret for signing the JWT, should be a string or byte[]. This is mandatory if the Header algorithm isn't "none".

Type: Object
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

System.String

NOTES