Test-KrJWT

SYNOPSIS

Validates a JWT token against the builder’s parameters.

SYNTAX

__AllParameterSets

Test-KrJWT [-Result] <JwtBuilderResult> [-Token] <string> [[-ClockSkew] <timespan>]
 [<CommonParameters>]

ALIASES

This cmdlet has the following aliases, {{Insert list of aliases}}

DESCRIPTION

This function validates a JWT token against the parameters set in the JWT builder, checking for expiration, issuer, audience, and other claims.

EXAMPLES

EXAMPLE 1

$isValid = New-KrJWTTokenBuilder | Add-KrJWTSubject -Subject “mySubject” | Build-KrJWT | Test-KrJWT -Token $token This example creates a new JWT token builder, adds a subject, and then tests the validity of the JWT token.

PARAMETERS

-ClockSkew

The allowed clock skew for validation, defaulting to 1 minute.

Type: System.TimeSpan
DefaultValue: ([TimeSpan]::FromMinutes(1))
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 2
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Result

The JWT builder result containing the token and validation parameters.

Type: Kestrun.Jwt.JwtBuilderResult
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Token

The JWT token to validate.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Kestrun.Jwt.JwtBuilderResult

{{ Fill in the Description }}

OUTPUTS

[bool]

Returns true if the token is valid

{{ Fill in the Description }}

System.Boolean

{{ Fill in the Description }}

NOTES

This function is part of the Kestrun.Jwt module and is used to validate JWT tokens. Maps to JwtBuilderResult.Validate