Example #1
0
        private static void ThrowIfInvalidOptions(JwtAuthenticationOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }


            if (options.SigningCredentials == null)
            {
                throw new ArgumentNullException(nameof(JwtAuthenticationOptions.SigningCredentials));
            }

            if (options.JtiGenerator == null)
            {
                throw new ArgumentNullException(nameof(JwtAuthenticationOptions.JtiGenerator));
            }
        }
Example #2
0
 public JwtFactory(IOptions <JwtAuthenticationOptions> jwtOptions)
 {
     _jwtOptions = jwtOptions.Value;
     ThrowIfInvalidOptions(_jwtOptions);
 }