Exemple #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services
            .AddControllersTransients()
            .AddUseCasesTransients()
            .AddMySqlPersistenceScopeds();

            services.UseMySql <PrmDbContext>(databaseName: "prm");
            services.AddControllers();
            AuthenticationSettingsExtensions.AddAuthentication(services);
        }
        public AuthenticationService(long masterIdentifier, SecureString password)
        {
            string filePath = SettingsUtility.GetAuthenticationSettingsFilePath(masterIdentifier);

            if (!File.Exists(filePath))
            {
                throw new KeyNotFoundException($"identifier={masterIdentifier}");
            }

            _authenticationSettings = AuthenticationSettingsExtensions.Load(filePath, password);
            Initializer             = new ExtendedInitializer(this);

            _password = password;
        }