Skip to content

Commit

Permalink
Fixed PublicOrigin
Browse files Browse the repository at this point in the history
  • Loading branch information
i8beef committed Jul 24, 2018
1 parent bb1aef8 commit c785e1a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/HomeAutio.Mqtt.GoogleHome/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@ public void ConfigureServices(IServiceCollection services)
// Identity Server 4
services.AddTransient<IPersistedGrantStore, PersistedGrantStore>();

var pathBase = Environment.GetEnvironmentVariable("ASPNETCORE_PATHBASE");
var authority = Configuration.GetValue<string>("oauth:authority");
var publicOrigin = !string.IsNullOrEmpty(pathBase)
? new Uri(new Uri(authority), pathBase).ToString()
: authority;

var signingCertFile = Configuration.GetValue<string>("oauth:signingCert:file");
var signingCertPassPhrase = Configuration.GetValue<string>("oauth:signingCert:passPhrase");
Expand All @@ -155,7 +151,7 @@ public void ConfigureServices(IServiceCollection services)
.AddIdentityServer(options =>
{
options.IssuerUri = authority;
options.PublicOrigin = publicOrigin;
options.PublicOrigin = authority;
})
.AddSigningCredential(cert)
.AddInMemoryClients(Clients.Get(Configuration))
Expand All @@ -169,7 +165,7 @@ public void ConfigureServices(IServiceCollection services)
.AddIdentityServer(options =>
{
options.IssuerUri = authority;
options.PublicOrigin = publicOrigin;
options.PublicOrigin = authority;
})
.AddDeveloperSigningCredential(true, "config/tempkey.rsa")
.AddInMemoryClients(Clients.Get(Configuration))
Expand Down

0 comments on commit c785e1a

Please sign in to comment.