Skip to content

Commit

Permalink
Added URI config for Blazor app
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-goldman committed Jun 28, 2023
1 parent b807e63 commit ade3f9c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/WebUI/Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ public static async Task Main(string[] args)
builder.RootComponents.Add<HeadOutlet>("head::after");

builder.Services.AddScoped<AuthHandler>();

builder.Services.AddHttpClient(AuthHandler.AuthenticatedClient, cfg => cfg.BaseAddress = new Uri("https://localhost:7132/"))

var apiUri = builder.Configuration["ApiUri"]!;

builder.Services.AddHttpClient(AuthHandler.AuthenticatedClient, cfg => cfg.BaseAddress = new Uri(apiUri))
.AddHttpMessageHandler((s) => s.GetService<AuthHandler>());

builder.Services.AddOidcAuthentication(options =>
Expand Down
3 changes: 2 additions & 1 deletion src/WebUI/wwwroot/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"Local": {
"Authority": "https://localhost:5001",
"ClientId": "dotnetflix-web-ui"
}
},
"ApiUri": "https://localhost:7132"
}
7 changes: 4 additions & 3 deletions src/WebUI/wwwroot/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"Local": {
"Authority": "https://login.microsoftonline.com/",
"ClientId": "33333333-3333-3333-33333333333333333"
}
"Authority": "https://dotnetflix-identity.azurewebsites.net/",
"ClientId": "dotnetflix-web-ui"
},
"ApiUri": "https://dotnetflix-api.azurewebsites.net/"
}

0 comments on commit ade3f9c

Please sign in to comment.