Class: ClientSelfSignedJwtAuthProvider

Isolated

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

1jwt:ClientSelfSignedJwtAuthProvider provider = new({
2 issuer: "wso2",
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 token = check provider.generateToken();

Return Type

(string | Error)

Generated token or else a jwt:Error if an error occurred