private static void ThrowIfInvalidOptions(MvJwtIssuerOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } if (options.ValidFor <= 0 /*TimeSpan.Zero*/) { throw new ArgumentException("Must be a non-zero TimeSpan.", nameof(MvJwtIssuerOptions.ValidFor)); } if (options.SigningCredentials == null) { throw new ArgumentNullException(nameof(MvJwtIssuerOptions.SigningCredentials)); } if (options.JtiGenerator == null) { throw new ArgumentNullException(nameof(MvJwtIssuerOptions.JtiGenerator)); } }
public JwtFactory(IOptions <MvJwtIssuerOptions> jwtOptions) { _jwtOptions = jwtOptions.Value; ThrowIfInvalidOptions(_jwtOptions); }