From cc2866dd0ffe473ce6face20ca7a1c6676767d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Thu, 22 Oct 2020 02:46:48 +0200 Subject: [PATCH] Update the samples to enable SSL/TLS --- samples/Mvc.Client/Controllers/HomeController.cs | 2 +- samples/Mvc.Client/Properties/launchSettings.json | 4 ++-- samples/Mvc.Client/Startup.cs | 2 +- samples/Mvc.Server/Properties/launchSettings.json | 4 ++-- samples/Mvc.Server/Worker.cs | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/samples/Mvc.Client/Controllers/HomeController.cs b/samples/Mvc.Client/Controllers/HomeController.cs index 2f2bc8f5..c6a9582e 100644 --- a/samples/Mvc.Client/Controllers/HomeController.cs +++ b/samples/Mvc.Client/Controllers/HomeController.cs @@ -33,7 +33,7 @@ namespace Mvc.Client.Controllers using var client = _httpClientFactory.CreateClient(); - using var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost:54540/api/message"); + using var request = new HttpRequestMessage(HttpMethod.Get, "https://localhost:44395/api/message"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token); using var response = await client.SendAsync(request, cancellationToken); diff --git a/samples/Mvc.Client/Properties/launchSettings.json b/samples/Mvc.Client/Properties/launchSettings.json index ea287081..1c7dcc5a 100644 --- a/samples/Mvc.Client/Properties/launchSettings.json +++ b/samples/Mvc.Client/Properties/launchSettings.json @@ -4,7 +4,7 @@ "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:53507", - "sslPort": 0 + "sslPort": 44381 } }, "profiles": { @@ -21,7 +21,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://localhost:53507/" + "applicationUrl": "https://localhost:44381/" } } } \ No newline at end of file diff --git a/samples/Mvc.Client/Startup.cs b/samples/Mvc.Client/Startup.cs index 32234d0e..6faacf97 100644 --- a/samples/Mvc.Client/Startup.cs +++ b/samples/Mvc.Client/Startup.cs @@ -41,7 +41,7 @@ namespace Mvc.Client // Note: setting the Authority allows the OIDC client middleware to automatically // retrieve the identity provider's configuration and spare you from setting // the different endpoints URIs or the token validation parameters explicitly. - options.Authority = "http://localhost:54540/"; + options.Authority = "https://localhost:44395/"; options.Scope.Add("email"); options.Scope.Add("roles"); diff --git a/samples/Mvc.Server/Properties/launchSettings.json b/samples/Mvc.Server/Properties/launchSettings.json index 0d172e93..9e078ae9 100644 --- a/samples/Mvc.Server/Properties/launchSettings.json +++ b/samples/Mvc.Server/Properties/launchSettings.json @@ -4,7 +4,7 @@ "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:54540", - "sslPort": 0 + "sslPort": 44395 } }, "profiles": { @@ -21,7 +21,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://localhost:54540/" + "applicationUrl": "https://localhost:44395/" } } } \ No newline at end of file diff --git a/samples/Mvc.Server/Worker.cs b/samples/Mvc.Server/Worker.cs index c7dbb710..ffb46102 100644 --- a/samples/Mvc.Server/Worker.cs +++ b/samples/Mvc.Server/Worker.cs @@ -45,11 +45,11 @@ namespace Mvc.Server }, PostLogoutRedirectUris = { - new Uri("http://localhost:53507/signout-callback-oidc") + new Uri("https://localhost:44381/signout-callback-oidc") }, RedirectUris = { - new Uri("http://localhost:53507/signin-oidc") + new Uri("https://localhost:44381/signin-oidc") }, Permissions = { @@ -73,8 +73,8 @@ namespace Mvc.Server // To test this sample with Postman, use the following settings: // - // * Authorization URL: http://localhost:54540/connect/authorize - // * Access token URL: http://localhost:54540/connect/token + // * Authorization URL: https://localhost:44395/connect/authorize + // * Access token URL: https://localhost:44395/connect/token // * Client ID: postman // * Client secret: [blank] (not used with public clients) // * Scope: openid email profile roles