From 696cad6017d468fb565782bfd1f57287e4a0d937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 6 Mar 2018 14:51:00 +0300 Subject: [PATCH] Changed localhost urls. --- .../Properties/launchSettings.json | 4 +- .../MicroserviceDemo.ConsoleClient/Program.cs | 4 +- .../MicroservicesDemoTenancyServiceModule.cs | 2 +- .../Properties/launchSettings.json | 4 +- .../Controllers/AccountController.cs | 6 +- .../MicroservicesDemoWebModule.cs | 2 +- .../Properties/launchSettings.json | 4 +- .../MicroserviceDemo.Web/appsettings.json | 2 +- src/MicroserviceDemo/README.md | 58 +++++++++++++++++++ 9 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 src/MicroserviceDemo/README.md diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json index abf272fae8..a1c4854f52 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json @@ -3,7 +3,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:54307/", + "applicationUrl": "http://abp-test-authserver.com:54307/", "sslPort": 0 } }, @@ -21,7 +21,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://localhost:54308/" + "applicationUrl": "http://abp-test-authserver.com:54308/" } } } diff --git a/src/MicroserviceDemo/MicroserviceDemo.ConsoleClient/Program.cs b/src/MicroserviceDemo/MicroserviceDemo.ConsoleClient/Program.cs index d2611feda0..d192c39bf5 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.ConsoleClient/Program.cs +++ b/src/MicroserviceDemo/MicroserviceDemo.ConsoleClient/Program.cs @@ -16,7 +16,7 @@ namespace MicroserviceDemo.ConsoleClient private static async Task RunDemo() { // discover endpoints from metadata - var disco = await DiscoveryClient.GetAsync("http://localhost:54307"); + var disco = await DiscoveryClient.GetAsync("http://abp-test-authserver.com:54307"); if (disco.IsError) { Console.WriteLine(disco.Error); @@ -39,7 +39,7 @@ namespace MicroserviceDemo.ConsoleClient var client = new HttpClient(); client.SetBearerToken(tokenResponse.AccessToken); - var response = await client.GetAsync("http://localhost:63877/api/multi-tenancy/tenant?SkipCount=0&MaxResultCount=100"); + var response = await client.GetAsync("http://abp-test-tenancy.com:63877/api/multi-tenancy/tenant?SkipCount=0&MaxResultCount=100"); if (!response.IsSuccessStatusCode) { Console.WriteLine(response.StatusCode); diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroservicesDemoTenancyServiceModule.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroservicesDemoTenancyServiceModule.cs index ede129e3d4..b8f96c327b 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroservicesDemoTenancyServiceModule.cs +++ b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroservicesDemoTenancyServiceModule.cs @@ -58,7 +58,7 @@ namespace MicroserviceDemo.TenancyService services.AddAuthentication("Bearer") .AddIdentityServerAuthentication(options => { - options.Authority = "http://localhost:54307"; + options.Authority = "http://abp-test-authserver.com:54307"; options.RequireHttpsMetadata = false; options.ApiName = "multi-tenancy-api"; diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Properties/launchSettings.json b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Properties/launchSettings.json index 1003164737..c45d7b98d3 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Properties/launchSettings.json +++ b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Properties/launchSettings.json @@ -3,7 +3,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:63877/", + "applicationUrl": "http://abp-test-tenancy.com:63877/", "sslPort": 0 } }, @@ -21,7 +21,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://localhost:63878/" + "applicationUrl": "http://abp-test-tenancy.com:63878/" } } } diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs index 233bd85f72..672911f8c6 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs +++ b/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs @@ -38,7 +38,7 @@ namespace MicroserviceDemo.Web.Controllers var client = new HttpClient(); client.SetBearerToken(accessToken); - var content = await client.GetStringAsync("http://localhost:63877/identity"); + var content = await client.GetStringAsync("http://abp-test-tenancy.com:63877/identity"); ViewBag.Json = JObject.Parse(content).ToString(); return View("json"); @@ -46,12 +46,12 @@ namespace MicroserviceDemo.Web.Controllers public async Task CallApiUsingClientCredentials() { - var tokenClient = new TokenClient("http://localhost:54307/connect/token", "client", "secret"); + var tokenClient = new TokenClient("http://abp-test-authserver.com:54307/connect/token", "client", "secret"); var tokenResponse = await tokenClient.RequestClientCredentialsAsync("multi-tenancy-api"); var client = new HttpClient(); client.SetBearerToken(tokenResponse.AccessToken); - var content = await client.GetStringAsync("http://localhost:63877/identity"); + var content = await client.GetStringAsync("http://abp-test-tenancy.com:63877/identity"); ViewBag.Json = JObject.Parse(content).ToString(); return View("json"); diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs index a92426aab1..0fa634c277 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs +++ b/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs @@ -80,7 +80,7 @@ namespace MicroserviceDemo.Web { options.SignInScheme = IdentityConstants.ApplicationScheme; - options.Authority = "http://localhost:54307"; + options.Authority = "http://abp-test-authserver.com:54307"; options.RequireHttpsMetadata = false; options.ClientId = "client"; diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Properties/launchSettings.json b/src/MicroserviceDemo/MicroserviceDemo.Web/Properties/launchSettings.json index a9ae94e883..0dc5bcbb84 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Properties/launchSettings.json +++ b/src/MicroserviceDemo/MicroserviceDemo.Web/Properties/launchSettings.json @@ -3,7 +3,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:61144/", + "applicationUrl": "http://abp-test-web.com:61144/", "sslPort": 0 } }, @@ -21,7 +21,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://localhost:61145/" + "applicationUrl": "http://abp-test-web.com:61145/" } } } diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/appsettings.json b/src/MicroserviceDemo/MicroserviceDemo.Web/appsettings.json index 176e9597e1..056c46bc29 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/appsettings.json +++ b/src/MicroserviceDemo/MicroserviceDemo.Web/appsettings.json @@ -7,7 +7,7 @@ }, "RemoteServices": { "AbpMultiTenancy": { - "BaseUrl": "http://localhost:63877/" + "BaseUrl": "http://abp-test-tenancy.com:63877/" } } } \ No newline at end of file diff --git a/src/MicroserviceDemo/README.md b/src/MicroserviceDemo/README.md new file mode 100644 index 0000000000..a025eb97ce --- /dev/null +++ b/src/MicroserviceDemo/README.md @@ -0,0 +1,58 @@ +# Micro-service Architecture Demo + +## Applications + +* **MicroserviceDemo.AuthServer**: Identity4 Server used for authentication. +* **MicroserviceDemo.TenancyService**: API service to manage tenants. +* **MicroserviceDemo.Web**: Web UI application to manage users, roles and tenants. + +## How To Run + +#### Run Database Migrations + +TODO:... Also need to seed database! + +#### Host File + +Add these lines into *C:\Windows\System32\drivers\etc\host* file: + +```` +127.0.0.1 openidclientdemo.com +127.0.0.1 abp-test-authserver.com +127.0.0.1 abp-test-web.com +127.0.0.1 abp-test-tenancy.com +```` + +#### IIS Express Configuration + +Add the sites into *C:\Users\%USER%\Documents\IISExpress\config\applicationhost.config* file: + +````xml + + + + + + + + + + + + + + + + + + + + + + + + + +```` + +... \ No newline at end of file