From 75629193b74427eef05ffe63d967007788e61987 Mon Sep 17 00:00:00 2001 From: Eduard Tomas Date: Mon, 3 Apr 2017 10:18:56 +0200 Subject: [PATCH 1/2] Xamarin callback client configurable --- docker-compose.override.yml | 1 + docker-compose.prod.yml | 1 + src/Services/Identity/Identity.API/Configuration/Config.cs | 2 +- src/Services/Identity/Identity.API/Startup.cs | 1 + src/Services/Identity/Identity.API/appsettings.json | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-compose.override.yml b/docker-compose.override.yml index bc53aa0f8..c6a984bab 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -33,6 +33,7 @@ services: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5105 - SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104 + - XamarinCallback=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 - ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word - MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your local dev-machine firewall at range 5100-5105. ports: diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 7e5c519e8..ec20d2b1a 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -38,6 +38,7 @@ services: - SpaClient=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5104 - ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word - MvcClient=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your host's firewall at range 5100-5105. + - XamarinCallback=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 ports: - "5105:5105" diff --git a/src/Services/Identity/Identity.API/Configuration/Config.cs b/src/Services/Identity/Identity.API/Configuration/Config.cs index 9c799ca68..f2a4abda9 100644 --- a/src/Services/Identity/Identity.API/Configuration/Config.cs +++ b/src/Services/Identity/Identity.API/Configuration/Config.cs @@ -59,7 +59,7 @@ namespace Identity.API.Configuration ClientName = "eShop Xamarin OpenId Client", AllowedGrantTypes = GrantTypes.Implicit, AllowAccessTokensViaBrowser = true, - RedirectUris = { "http://eshopxamarin/callback.html" }, + RedirectUris = { $"{clientsUrl["Xamarin"]}/" }, RequireConsent = false, PostLogoutRedirectUris = { "http://13.88.8.119:5105/Account/Redirecting", "http://10.6.1.234:5105/Account/Redirecting" }, AllowedCorsOrigins = { "http://eshopxamarin" }, diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index a58b5a6d9..a076605eb 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -73,6 +73,7 @@ namespace eShopOnContainers.Identity Dictionary clientUrls = new Dictionary(); clientUrls.Add("Mvc", Configuration.GetValue("MvcClient")); clientUrls.Add("Spa", Configuration.GetValue("SpaClient")); + clientUrls.Add("Xamarin", Configuration.GetValue("XamarinCallback")); // Adds IdentityServer services.AddIdentityServer(x => x.IssuerUri = "null") diff --git a/src/Services/Identity/Identity.API/appsettings.json b/src/Services/Identity/Identity.API/appsettings.json index b41f05352..6b99eb28a 100644 --- a/src/Services/Identity/Identity.API/appsettings.json +++ b/src/Services/Identity/Identity.API/appsettings.json @@ -4,6 +4,7 @@ }, "MvcClient": "http://localhost:5100", "SpaClient": "http://localhost:5104", + "XamarinCallback": "http://localhost:5105", "Logging": { "IncludeScopes": false, "LogLevel": { From d00588ae37ac773a34e492f2e3cc8bc059d5153f Mon Sep 17 00:00:00 2001 From: Eduard Tomas Date: Wed, 5 Apr 2017 15:53:04 +0200 Subject: [PATCH 2/2] Updated IdSvr for Xamarin-UWP signin related problems --- docker-compose.override.yml | 2 +- docker-compose.prod.yml | 2 +- src/Services/Identity/Identity.API/Configuration/Config.cs | 2 +- src/Services/Identity/Identity.API/appsettings.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.override.yml b/docker-compose.override.yml index c6a984bab..f96a8d177 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -33,7 +33,7 @@ services: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5105 - SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104 - - XamarinCallback=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 + - XamarinCallback=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105/xamarincallback #localhost do not work for UWP login, so we have to use "external" IP always - ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word - MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your local dev-machine firewall at range 5100-5105. ports: diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index ec20d2b1a..80b44a9ad 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -38,7 +38,7 @@ services: - SpaClient=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5104 - ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word - MvcClient=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your host's firewall at range 5100-5105. - - XamarinCallback=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 + - XamarinCallback=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105/xamarincallback ports: - "5105:5105" diff --git a/src/Services/Identity/Identity.API/Configuration/Config.cs b/src/Services/Identity/Identity.API/Configuration/Config.cs index f2a4abda9..fc6d3d5b6 100644 --- a/src/Services/Identity/Identity.API/Configuration/Config.cs +++ b/src/Services/Identity/Identity.API/Configuration/Config.cs @@ -59,7 +59,7 @@ namespace Identity.API.Configuration ClientName = "eShop Xamarin OpenId Client", AllowedGrantTypes = GrantTypes.Implicit, AllowAccessTokensViaBrowser = true, - RedirectUris = { $"{clientsUrl["Xamarin"]}/" }, + RedirectUris = { clientsUrl["Xamarin"] }, RequireConsent = false, PostLogoutRedirectUris = { "http://13.88.8.119:5105/Account/Redirecting", "http://10.6.1.234:5105/Account/Redirecting" }, AllowedCorsOrigins = { "http://eshopxamarin" }, diff --git a/src/Services/Identity/Identity.API/appsettings.json b/src/Services/Identity/Identity.API/appsettings.json index 6b99eb28a..c188cb721 100644 --- a/src/Services/Identity/Identity.API/appsettings.json +++ b/src/Services/Identity/Identity.API/appsettings.json @@ -4,7 +4,7 @@ }, "MvcClient": "http://localhost:5100", "SpaClient": "http://localhost:5104", - "XamarinCallback": "http://localhost:5105", + "XamarinCallback": "http://localhost:5105/xamarincallback", "Logging": { "IncludeScopes": false, "LogLevel": {