ballerina/jwt

Package Overview

This package provides a listener JWT authentication provider, which can be used to authenticate the provided credentials against the provided JWT validator configurations, and a client self-signed JWT authentication provider, which can be used to authenticate against an external endpoint with a self-signed JWT issued against the provided JWT issuer configurations. Also, this module provides the functionality related to issuing and validating a JWT.

For information on the operations, which you can perform with this module, see the below Functions. For examples on the usage of the operations, see the following.

Functions

[3]

decode

Decodes the provided JWT string.

issue

Issues a JWT based on the provided configurations.

validate

Validates the provided JWT, against the provided configurations.

Classes

[2]

ClientSelfSignedJwtAuthProvider

Represents the client JWT Auth provider, which is used to authenticate with an external endpoint by issuing a self-signed JWT.

ListenerJwtAuthProvider

Represents the listener JWT Auth provider, which authenticates by validating a JWT.

Records

[9]

CertKey

Represents combination of certificate, private key and private key password if encrypted.

ClientConfiguration

Represents the configurations of the client used to call the JWKS endpoint.

Represents JWT header.

IssuerConfig

Represents JWT issuer configurations.

IssuerSignatureConfig

Represents JWT signature configurations.

Payload

Represents JWT payload.

SecureSocket

Represents the SSL/TLS configurations.

ValidatorConfig

Represents JWT validator configurations.

ValidatorSignatureConfig

Represents JWT signature configurations.

Constants

[4]

NONE

Unsecured JWS (no signing).

RS256

The RSA-SHA256 algorithm.

RS384

The RSA-SHA384 algorithm.

RS512

The RSA-SHA512 algorithm.

Enums

[1]

HttpVersion

Represents HTTP versions.

Types

[1]

SigningAlgorithm

The cryptographic algorithms used to secure the JWS.

Errors

[1]

Error

Represents the JWT error.