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()); }
static public JWTBuilder New(IAudience options) { var builder = new JWTBuilder(options); return(builder); }