Class: ClientBasicAuthProvider

Isolated

Represents the client Basic Auth provider, which is used to authenticate with an external endpoint by generating a Basic Auth token against the provided credential configurations.

1auth:CredentialsConfig config = {
2 username: "tom",
3 password: "123"
4}
5auth:ClientBasicAuthProvider provider = new(config);

Constructor

Provides authentication based on the provided Basic Auth configurations.

init (CredentialsConfig credentialsConfig)

Methods

generateToken

Generates a Base64-encoded token for Basic Auth authentication.

generateToken

function generateToken() returns string | Error
Isolated Function

Generates a Base64-encoded token for Basic Auth authentication.

1string token = check provider.generateToken();

Return Type

(string | Error)

The generated token or else an auth:Error if an error occurred