示例#1
0
        public static void AddArgonaut(this IServiceCollection services, IAudience audience)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            if (audience == null)
            {
                throw new ArgumentNullException(nameof(audience));
            }

            var jwtBuilder = new Argonaut.Internal.JWTBuilder(audience);

            services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
            .AddJwtBearer(options => options.TokenValidationParameters = jwtBuilder.validationParameters.SecretAndExpirationDate());
        }
示例#2
0
        static public JWTBuilder New(IAudience options)
        {
            var builder = new JWTBuilder(options);

            return(builder);
        }