diff --git a/README.md b/README.md index 31118ce6e..a3ecf20e9 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,10 @@ Once the deploy process of docker-compose finishes you should be able to access - ASP.NET Identity database (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word - Basket data (Redis): listening at localhost:6379 +To test the microservices deployed in local Docker in a Xamarin App it is necessary to add the IP address of the development machine in the Settings section of the App. In addition, is neccesary to open the port where you want to access the docker service in the local firewall. + + + #### Trying the WebMVC application with the DemoUser@microsoft.com user account When you try the WebMVC application by using the url •Web MVC: http://localhost:5100, you'll be able to test the home page which is also the catalog page. But when trying to add any article to the basket you will get redirected to the login page which is handled by the STS microservice (Security Token Service). At this point, you could register your own user/customer or you can also use the a convenient default user/customer named DemoUser@microsoft.com so you don't need to register and it'll be faster. The credentials are: diff --git a/img/xamarin-settings.png b/img/xamarin-settings.png new file mode 100644 index 000000000..437909176 Binary files /dev/null and b/img/xamarin-settings.png differ diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs index f6b8851c4..2f824b61d 100644 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs +++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs @@ -73,8 +73,6 @@ namespace eShopOnContainers.ViewModels.Base _unityContainer.RegisterInstance(new OrderMockService()); _unityContainer.RegisterInstance(new UserMockService()); - Settings.AuthAccessToken = GlobalSetting.Instance.AuthToken; - UseMockService = true; } else diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/LoginViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/LoginViewModel.cs index 9f66c3e0e..96c5009cd 100644 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/LoginViewModel.cs +++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/LoginViewModel.cs @@ -175,6 +175,8 @@ namespace eShopOnContainers.Core.ViewModels if (isAuthenticated) { + Settings.AuthAccessToken = GlobalSetting.Instance.AuthToken; + await NavigationService.NavigateToAsync(); await NavigationService.RemoveLastFromBackStackAsync(); } @@ -211,6 +213,12 @@ namespace eShopOnContainers.Core.ViewModels // Logout LoginUrl = logoutRequest; } + + if(ViewModelLocator.Instance.UseMockService) + { + Settings.AuthAccessToken = string.Empty; + Settings.AuthIdToken = string.Empty; + } } private async void NavigateAsync(string url)