Browse Source

Update the samples to enable SSL/TLS

pull/1147/head
Kévin Chalet 5 years ago
parent
commit
cc2866dd0f
  1. 2
      samples/Mvc.Client/Controllers/HomeController.cs
  2. 4
      samples/Mvc.Client/Properties/launchSettings.json
  3. 2
      samples/Mvc.Client/Startup.cs
  4. 4
      samples/Mvc.Server/Properties/launchSettings.json
  5. 8
      samples/Mvc.Server/Worker.cs

2
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);

4
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/"
}
}
}

2
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");

4
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/"
}
}
}

8
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

Loading…
Cancel
Save