|
|
@ -1,5 +1,6 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
using System.Security.Principal;
|
|
|
|
using System.Security.Principal;
|
|
|
|
using AutoMapper;
|
|
|
|
using AutoMapper;
|
|
|
|
using AutoMapper.EquivalencyExpression;
|
|
|
|
using AutoMapper.EquivalencyExpression;
|
|
|
@ -10,6 +11,7 @@ using IdentityServer4.Services;
|
|
|
|
using IdentityServer4.Validation;
|
|
|
|
using IdentityServer4.Validation;
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Hosting.Server.Features;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
|
|
|
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
|
|
|
using Microsoft.AspNetCore.SpaServices.Webpack;
|
|
|
|
using Microsoft.AspNetCore.SpaServices.Webpack;
|
|
|
@ -180,12 +182,18 @@ namespace Ombi
|
|
|
|
//loggerFactory.AddDebug();
|
|
|
|
//loggerFactory.AddDebug();
|
|
|
|
var options = (IOptions<UserSettings>) app.ApplicationServices.GetService(
|
|
|
|
var options = (IOptions<UserSettings>) app.ApplicationServices.GetService(
|
|
|
|
typeof(IOptions<UserSettings>));
|
|
|
|
typeof(IOptions<UserSettings>));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ctx = (IOmbiContext)app.ApplicationServices.GetService(typeof(IOmbiContext));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get the url
|
|
|
|
|
|
|
|
var url = ctx.ApplicationConfigurations.FirstOrDefault(x => x.Type == ConfigurationTypes.Url);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine($"Using Url {url.Value} for Identity Server");
|
|
|
|
app.UseIdentity();
|
|
|
|
app.UseIdentity();
|
|
|
|
app.UseIdentityServer();
|
|
|
|
app.UseIdentityServer();
|
|
|
|
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
|
|
|
|
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Authority = options.Value.WebsiteUrl,
|
|
|
|
Authority = url.Value,
|
|
|
|
ApiName = "api",
|
|
|
|
ApiName = "api",
|
|
|
|
ApiSecret = "secret",
|
|
|
|
ApiSecret = "secret",
|
|
|
|
|
|
|
|
|
|
|
@ -234,7 +242,6 @@ namespace Ombi
|
|
|
|
|
|
|
|
|
|
|
|
// Setup the scheduler
|
|
|
|
// Setup the scheduler
|
|
|
|
var jobSetup = (IJobSetup)app.ApplicationServices.GetService(typeof(IJobSetup));
|
|
|
|
var jobSetup = (IJobSetup)app.ApplicationServices.GetService(typeof(IJobSetup));
|
|
|
|
var ctx = (IOmbiContext)app.ApplicationServices.GetService(typeof(IOmbiContext));
|
|
|
|
|
|
|
|
jobSetup.Setup();
|
|
|
|
jobSetup.Setup();
|
|
|
|
ctx.Seed();
|
|
|
|
ctx.Seed();
|
|
|
|
|
|
|
|
|
|
|
|