jwt

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJWTLifetime

func GetJWTLifetime(
	ctx context.Context,
	rawToken string,
) (time.Time, time.Time, error)

GetJWTLifetime returns the issued at(iat) and expiration time(exp) claims present in the JWT token. These are optional claims and may not be present in the token. Absence is not reported as an error.

An error is returned if the supplied token is malformed. Times are returned in UTC to have parity with graph responses.

func IsJWTExpired

func IsJWTExpired(
	rawToken string,
) (bool, error)

IsJWTExpired checks if the JWT token is past expiry by analyzing the "exp" claim present in the token. Token is considered expired if "exp" claim < current time. Missing "exp" claim is considered as non-expired. An error is returned if the supplied token is malformed.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL