Bearbeiten

Share via


SignedHttpRequest class

Constructors

SignedHttpRequest(SignedHttpRequestParameters, SignedHttpRequestOptions)

Methods

generatePublicKeyThumbprint()

Generates and caches a keypair for the given request options.

removeKeys(string)

Removes cached keys from browser for given public key thumbprint

signRequest(string, string, object)

Generates a signed http request for the given payload with the given key.

Constructor Details

SignedHttpRequest(SignedHttpRequestParameters, SignedHttpRequestOptions)

new SignedHttpRequest(shrParameters: SignedHttpRequestParameters, shrOptions?: SignedHttpRequestOptions)

Parameters

shrParameters

SignedHttpRequestParameters

Method Details

generatePublicKeyThumbprint()

Generates and caches a keypair for the given request options.

function generatePublicKeyThumbprint(): Promise<string>

Returns

Promise<string>

Public key digest, which should be sent to the token issuer.

removeKeys(string)

Removes cached keys from browser for given public key thumbprint

function removeKeys(publicKeyThumbprint: string): Promise<boolean>

Parameters

publicKeyThumbprint

string

Public key digest (from generatePublicKeyThumbprint API)

Returns

Promise<boolean>

If keys are properly deleted

signRequest(string, string, object)

Generates a signed http request for the given payload with the given key.

function signRequest(payload: string, publicKeyThumbprint: string, claims?: object): Promise<string>

Parameters

payload

string

Payload to sign (e.g. access token)

publicKeyThumbprint

string

Public key digest (from generatePublicKeyThumbprint API)

claims

object

Additional claims to include/override in the signed JWT

Returns

Promise<string>

Pop token signed with the corresponding private key