public void SetUp() { _submarineAuthenticationSettings = new SubmarineTestAuthenticationSettings { SaltingRounds = 10 }; _classUnderTest = new HashTextQueryHandler(_submarineAuthenticationSettings); }
public static void AddSubmarineAuthentication(this IServiceCollection serviceCollection, ISubmarineAuthenticationSettings settings) { serviceCollection.AddAuthentication(x => { x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; }) .AddJwtBearer(x => { x.RequireHttpsMetadata = false; x.SaveToken = true; x.TokenValidationParameters = new TokenValidationParameters { ValidateIssuerSigningKey = true, ValidateAudience = false, IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(settings.Secret)), ValidIssuers = new [] { settings.Issuer } }; }); }
public GenerateBearerTokenQueryHandler(ISubmarineAuthenticationSettings submarineAuthenticationSettings) { _submarineAuthenticationSettings = submarineAuthenticationSettings; }
public HashTextQueryHandler(ISubmarineAuthenticationSettings submarineAuthenticationSettings) { _submarineAuthenticationSettings = submarineAuthenticationSettings; }
public static void AddSubmarineAuthenticationSettings(this IServiceCollection serviceCollection, ISubmarineAuthenticationSettings submarineAuthenticationSettings) { serviceCollection.AddSingleton(submarineAuthenticationSettings); }