Skip to main content

@wildix/auth-utils > OpenIdPbxProvider

OpenIdPbxProvider class

The OpenIdPbxProvider class is a token provider implementation that facilitates the retrieval of OpenID tokens. It works with auth service to securely obtain OpenID tokens by using pbx credentials.

Example Usage:

const openIdPbxInput: OpenIdPbxInput = {
pbxSerial: "221100ffffff",
pbxKey: "myPbxLicenseKey",
aud: "myServiceAudience",
scope: "get"
};

const environment: ServiceTokenEnv = "prod"; // Optional, could be "prod", "stage", or "stable"

const openIdProvider = new OpenIdPbxProvider(openIdPbxInput, environment);

try {
const idToken = await openIdProvider.token();
console.log("Received OpenID Token:", idToken);
} catch (error) {
console.error("Error fetching OpenID Token:", error.message);
}

The implementation encapsulates the logic for obtaining and caching OpenID tokens securely, abstracting away the details of the authentication process involving the auth service. The tokens are used primarily for authenticating with services that require OpenID compliance.

Signature:

export declare class OpenIdPbxProvider implements TokenProvider 

Implements: TokenProvider

Constructors

Constructor

Modifiers

Description

(constructor)(params, env)

Constructs a new instance of the OpenIdPbxProvider class

Properties

Property

Modifiers

Type

Description

aud

string

authHost

string

cachedToken

string | undefined

cachedTokenTtl

number | undefined

pbxKey

string

pbxSerial

string

scope

string

Methods

Method

Modifiers

Description

token()