<commit_before>﻿using Microsoft.Owin;
using Microsoft.Owin.Security.ActiveDirectory;
using Owin;
using SFA.DAS.NLog.Logger;
using SFA.DAS.Support.Shared.SiteConnection;

[assembly: OwinStartup(typeof(SFA.DAS.EmployerUsers.Support.Web.Startup))]

namespace SFA.DAS.EmployerUsers.Support.Web
{
    public class Startup
    {
        private readonly ILog _logger;
        private readonly ISiteValidatorSettings _siteValidatorSettings;

        public Startup(ILog logger, ISiteValidatorSettings siteValidatorSettings)
        {
            _logger = logger;
            _siteValidatorSettings = siteValidatorSettings;
        }

        public void Configuration(IAppBuilder app)
        {
            _logger.Info($"Configure Authentication Audience:{_siteValidatorSettings.Audience} Tenant:{_siteValidatorSettings.Tenant}");

            app.UseWindowsAzureActiveDirectoryBearerAuthentication(
               new WindowsAzureActiveDirectoryBearerAuthenticationOptions
               {
                   TokenValidationParameters = new System.IdentityModel.Tokens.TokenValidationParameters
                   {
                       ValidAudiences = _siteValidatorSettings.Audience.Split(','),
                       RoleClaimType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role"
                   },
                   Tenant = _siteValidatorSettings.Tenant
               });
        }
    }
}<commit_msg>Removed dependency injection from OwinStartup which does not resolve<commit_after>﻿using Microsoft.Owin;
using Microsoft.Owin.Security.ActiveDirectory;
using Owin;
using SFA.DAS.NLog.Logger;
using SFA.DAS.Support.Shared.SiteConnection;
using System.Web.Mvc;

[assembly: OwinStartup(typeof(SFA.DAS.EmployerUsers.Support.Web.Startup))]

namespace SFA.DAS.EmployerUsers.Support.Web
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            var logger = DependencyResolver.Current.GetService<ILog>();
            var siteValidatorSettings = DependencyResolver.Current.GetService<ISiteValidatorSettings>();
            
            logger.Info($"Configure Authentication Audience:{siteValidatorSettings.Audience} Tenant:{siteValidatorSettings.Tenant}");

            app.UseWindowsAzureActiveDirectoryBearerAuthentication(
               new WindowsAzureActiveDirectoryBearerAuthenticationOptions
               {
                   TokenValidationParameters = new System.IdentityModel.Tokens.TokenValidationParameters
                   {
                       ValidAudiences = siteValidatorSettings.Audience.Split(','),
                       RoleClaimType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role"
                   },
                   Tenant = siteValidatorSettings.Tenant
               });
        }
    }
}
{'fraction_non_alphanumeric': 0.0797436810252759, 'fraction_numerical': 0.004271982912068352, 'mean_word_length': 2.5614702154626108, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6979944', 'n_tokens_mistral': 730, 'n_tokens_neox': 689, 'n_words': 107}