validateToken method

Stream<Exception> validateToken (
  1. {bool validateClaims: true,
  2. bool validateExpiry: true}
)

Implementation

Stream<Exception> validateToken(
    {bool validateClaims: true, bool validateExpiry: true}) async* {
  var keyStore = new JsonWebKeyStore()
    ..addKeySetUrl(client.issuer.metadata.jwksUri);
  if (!await idToken.verify(keyStore,
      allowedArguments:
          client.issuer.metadata.idTokenSigningAlgValuesSupported)) {
    yield new JoseException("Could not verify token signature");
  }

  yield* new Stream.fromIterable(idToken.claims.validate(
      expiryTolerance: validateExpiry ? const Duration(seconds: 30) : null,
      issuer: client.issuer.metadata.issuer,
      clientId: client.clientId,
      nonce: nonce));
}