diff --git a/Ombi/Ombi/Ombi.csproj b/Ombi/Ombi/Ombi.csproj index 1b36335d5..da2b80034 100644 --- a/Ombi/Ombi/Ombi.csproj +++ b/Ombi/Ombi/Ombi.csproj @@ -3,7 +3,7 @@ netcoreapp1.1 win10-x64;osx.10.12-x64;ubuntu.16.10-x64;debian.8-x64; - portable-net45+win8 + True @@ -11,9 +11,6 @@ - - - @@ -45,24 +42,4 @@ - - - - ..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Configuration.dll - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - diff --git a/Ombi/Ombi/Program.cs b/Ombi/Ombi/Program.cs index d4867e9cb..1be157110 100644 --- a/Ombi/Ombi/Program.cs +++ b/Ombi/Ombi/Program.cs @@ -11,6 +11,7 @@ namespace Ombi { public static void Main(string[] args) { + Console.WriteLine(Directory.GetCurrentDirectory()); Console.Title = "Ombi"; var host = new WebHostBuilder() .UseKestrel() diff --git a/Ombi/Ombi/Startup.Auth.cs b/Ombi/Ombi/Startup.Auth.cs index 3005dc941..020cad2de 100644 --- a/Ombi/Ombi/Startup.Auth.cs +++ b/Ombi/Ombi/Startup.Auth.cs @@ -20,13 +20,13 @@ namespace Ombi private void ConfigureAuth(IApplicationBuilder app) { - var signingKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(Configuration.GetSection("TokenAuthentication:SecretKey").Value)); + var signingKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes("secretkey_secretkey123!")); var tokenProviderOptions = new TokenProviderOptions { - Path = Configuration.GetSection("TokenAuthentication:TokenPath").Value, - Audience = Configuration.GetSection("TokenAuthentication:Audience").Value, - Issuer = Configuration.GetSection("TokenAuthentication:Issuer").Value, + Path = "/api/v1/token/", + Audience = "DemoAudience", + Issuer = "DemoIssuer", SigningCredentials = new SigningCredentials(signingKey, SecurityAlgorithms.HmacSha256), IdentityResolver = GetIdentity }; @@ -38,10 +38,10 @@ namespace Ombi IssuerSigningKey = signingKey, // Validate the JWT Issuer (iss) claim ValidateIssuer = true, - ValidIssuer = Configuration.GetSection("TokenAuthentication:Issuer").Value, + ValidIssuer = "DemoIssuer", // Validate the JWT Audience (aud) claim ValidateAudience = true, - ValidAudience = Configuration.GetSection("TokenAuthentication:Audience").Value, + ValidAudience = "DemoAudience", // Validate the token expiry ValidateLifetime = true, // If you want to allow a certain amount of clock drift, set that here: @@ -61,14 +61,6 @@ namespace Ombi private async Task GetIdentity(string username, string password, IUserIdentityManager userIdentityManager) { - //await userIdentityManager.CreateUser(new UserDto - //{ - // Username = "a", - // Password = "a", - // Claims = new List() { new Claim(ClaimTypes.Role, "Admin")}, - // UserType = UserType.LocalUser, - //}); - var validLogin = await userIdentityManager.CredentialsValid(username, password); if (!validLogin) { diff --git a/Ombi/Ombi/Startup.cs b/Ombi/Ombi/Startup.cs index f739443fb..42a09ebc9 100644 --- a/Ombi/Ombi/Startup.cs +++ b/Ombi/Ombi/Startup.cs @@ -1,5 +1,4 @@ using System; -using System.Configuration; using System.Security.Principal; using AutoMapper; using AutoMapper.EquivalencyExpression; @@ -23,6 +22,7 @@ namespace Ombi { public Startup(IHostingEnvironment env) { + Console.WriteLine(env.ContentRootPath); var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", false, true) @@ -68,11 +68,6 @@ namespace Ombi { app.UseDeveloperExceptionPage(); } - else - { - app.UseExceptionHandler("/Home/Error"); - } - app.UseHangfireServer(); app.UseHangfireDashboard(); @@ -84,13 +79,13 @@ namespace Ombi ConfigureAuth(app); - var provider = new FileExtensionContentTypeProvider(); - provider.Mappings[".map"] = "application/octet-stream"; + //var provider = new FileExtensionContentTypeProvider(); + //provider.Mappings[".map"] = "application/octet-stream"; - app.UseStaticFiles(new StaticFileOptions() - { - ContentTypeProvider = provider - }); + //app.UseStaticFiles(new StaticFileOptions() + //{ + // ContentTypeProvider = provider + //}); app.UseMvc(routes => {