ClientAssertion class

Client assertion of type jwt-bearer used in confidential client flows

Methods

fromAssertion(string)

Initialize the ClientAssertion class from the clientAssertion passed by the user

fromCertificate(string, string, string)

Initialize the ClientAssertion class from the certificate passed by the user

getJwt(CryptoProvider, string, string)

Update JWT for certificate based clientAssertion, if passed by the user, uses it as is

parseCertificate(string)

Extracts the raw certs from a given certificate string and returns them in an array.

Method Details

fromAssertion(string)

Initialize the ClientAssertion class from the clientAssertion passed by the user

static function fromAssertion(assertion: string): ClientAssertion

Parameters

assertion

string

refer https://tools.ietf.org/html/rfc7521

Returns

fromCertificate(string, string, string)

Initialize the ClientAssertion class from the certificate passed by the user

static function fromCertificate(thumbprint: string, privateKey: string, publicCertificate?: string): ClientAssertion

Parameters

thumbprint

string

identifier of a certificate

privateKey

string

secret key

publicCertificate

string

electronic document provided to prove the ownership of the public key

Returns

getJwt(CryptoProvider, string, string)

Update JWT for certificate based clientAssertion, if passed by the user, uses it as is

function getJwt(cryptoProvider: CryptoProvider, issuer: string, jwtAudience: string): string

Parameters

cryptoProvider
CryptoProvider

library's crypto helper

issuer

string

iss claim

jwtAudience

string

aud claim

Returns

string

parseCertificate(string)

Extracts the raw certs from a given certificate string and returns them in an array.

static function parseCertificate(publicCertificate: string): Array<string>

Parameters

publicCertificate

string

electronic document provided to prove the ownership of the public key

Returns

Array<string>