Skip to content

Commit

Permalink
Pass audience via AuthZeroClientConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
amcclain committed Jan 17, 2025
1 parent abf1e04 commit 0907f19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client-app/src/core/AuthModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ export class AuthModel extends HoistAuthModel {

// Otherwise we proceed with the primary OAuth flow by constructing and initializing an AuthZeroClient, one of
// the OAuth implementations supported out-of-the-box by Hoist.
const audience = 'toolbox.xh.io';
this.client = new AuthZeroClient({
idScopes: ['profile'],
// Toolbox does not actually need any access tokens -- just a test
accessTokens: {
test: {scopes: ['profile'], audience: 'toolbox.xh.io'}
test: {scopes: ['profile'], audience}
},
// This config works along with the accessToken requested above - by passing the same
// audience to our interactive login requests, they return access/refresh tokens that
// are immediately usable.
audience,
...(config as AuthZeroClientConfig)
});
await this.client.initAsync();
Expand Down

0 comments on commit 0907f19

Please sign in to comment.