diff --git a/packages/pds/src/auth-verifier.ts b/packages/pds/src/auth-verifier.ts index bc23b2e6e69..953e7a79806 100644 --- a/packages/pds/src/auth-verifier.ts +++ b/packages/pds/src/auth-verifier.ts @@ -224,9 +224,18 @@ export class AuthVerifier { userServiceAuth = async (ctx: ReqCtx): Promise => { const payload = await this.verifyServiceJwt(ctx, { - aud: this.dids.entryway ?? this.dids.pds, + aud: null, iss: null, }) + if ( + payload.aud !== this.dids.pds && + (!this.dids.entryway || payload.aud !== this.dids.entryway) + ) { + throw new AuthRequiredError( + 'jwt audience does not match service did', + 'BadJwtAudience', + ) + } return { credentials: { type: 'user_service_auth',