Class: ClientSelfSignedJwtAuthProvider

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

1jwt:ClientSelfSignedJwtAuthProvider provider = new({
2 issuer: "example",
3 audience: ["ballerina"],
4 keyStoreConfig: {
5 keyAlias: "ballerina",
6 keyPassword: "ballerina",
7 keyStore: {
8 path: "/path/to/keystore.p12",
9 password: "ballerina"
10 }
11 }
12});

Constructor

Provides authentication based on the provided JWT configurations.

init (IssuerConfig issuerConfig)

Methods

generateToken

Issues a self-signed JWT for authentication.

generateToken

function generateToken() returns string | Error
Isolated Function

Issues a self-signed JWT for authentication.

1string|auth:Error token = provider.generateToken();

Return Type

(string | Error)

Generated token or else an auth:Error if token can't be generated