validate method

  1. @override
Iterable<Exception> validate({
  1. Duration expiryTolerance = const Duration(),
  2. Uri? issuer,
  3. String? clientId,
  4. String? nonce,
})

Implementation

@override
Iterable<Exception> validate(
    {Duration expiryTolerance = const Duration(),
    Uri? issuer,
    String? clientId,
    String? nonce}) sync* {
  yield* super.validate(
      expiryTolerance: expiryTolerance, issuer: issuer, clientId: clientId);
  if (audience.length > 1 && authorizedParty == null) {
    yield JoseException('No authorized party claim present.');
  }

  if (authorizedParty != null && authorizedParty != clientId) {
    yield JoseException('Invalid authorized party claim.');
  }

  if (nonce != null && nonce != this.nonce) {
    yield JoseException('Nonce does not match.');
  }
}