Skip to content

Commit a8f2606

Browse files
committed
Include endpoint as additional audience.
1 parent 0c253a6 commit a8f2606

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test-client/src/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function getCredentials(options: CredentialsOptions): Promise<{ end
3737
endpoint = `http://127.0.0.1:${parsed.port ?? 8080}`;
3838
}
3939

40-
const aud = parsed.client_auth?.audience?.[0] ?? endpoint;
40+
const aud = [parsed.client_auth?.audience?.[0], endpoint].filter((a) => a != null);
4141

4242
const rawKey = keys[0];
4343
const key = await jose.importJWK(rawKey);
@@ -50,7 +50,7 @@ export async function getCredentials(options: CredentialsOptions): Promise<{ end
5050
.setIssuedAt()
5151
.setIssuer('test-client')
5252
.setAudience(aud)
53-
.setExpirationTime('1h')
53+
.setExpirationTime('24h')
5454
.sign(key);
5555

5656
return { token, endpoint };

0 commit comments

Comments
 (0)