Skip to content

Commit

Permalink
feat(oidc-client): add dpop extras to claims (alpha)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Mar 19, 2024
1 parent 7b4580a commit c7793c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/oidc-client/src/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,13 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
});
}

async generateDemonstrationOfProofOfPossessionAsync(accessToken:string, url:string, method:string): Promise<string> {
async generateDemonstrationOfProofOfPossessionAsync(accessToken:string, url:string, method:string, extras:StringMap= {}): Promise<string> {

const configuration = this.configuration;
const claimsExtras = {ath: await base64urlOfHashOfASCIIEncodingAsync(accessToken),};
const claimsExtras = {
ath: await base64urlOfHashOfASCIIEncodingAsync(accessToken),
...extras
};

const serviceWorker = await initWorkerAsync(configuration, this.configurationName);
let demonstratingProofOfPossessionNonce:string;
Expand Down
4 changes: 2 additions & 2 deletions packages/oidc-client/src/oidcClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export class OidcClient {
return this._oidc.configuration;
}

async generateDemonstrationOfProofOfPossessionAsync(accessToken:string, url:string, method:string) : Promise<string> {
return this._oidc.generateDemonstrationOfProofOfPossessionAsync(accessToken, url, method);
async generateDemonstrationOfProofOfPossessionAsync(accessToken:string, url:string, method:string, extras:StringMap= {}) : Promise<string> {
return this._oidc.generateDemonstrationOfProofOfPossessionAsync(accessToken, url, method, extras);
}

async getValidTokenAsync(waitMs = 200, numberWait = 50): Promise<ValidToken> {
Expand Down

0 comments on commit c7793c9

Please sign in to comment.