Skip to content

Commit 967a007

Browse files
committed
Updated general Documentation to include Xamrin deploy with local services
1 parent aad71f4 commit 967a007

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ Once the deploy process of docker-compose finishes you should be able to access
111111
- ASP.NET Identity database (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word
112112
- Basket data (Redis): listening at localhost:6379
113113

114+
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.
115+
116+
<img src="img/xamarin-settings.png">
117+
114118
#### Trying the WebMVC application with the DemoUser@microsoft.com user account
115119
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.
116120
The credentials are:

img/xamarin-settings.png

14 KB
Loading

src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ public void UpdateDependencies(bool useMockServices)
7373
_unityContainer.RegisterInstance<IOrderService>(new OrderMockService());
7474
_unityContainer.RegisterInstance<IUserService>(new UserMockService());
7575

76-
Settings.AuthAccessToken = GlobalSetting.Instance.AuthToken;
77-
7876
UseMockService = true;
7977
}
8078
else

src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/LoginViewModel.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ private async void MockSignInAsync()
175175

176176
if (isAuthenticated)
177177
{
178+
Settings.AuthAccessToken = GlobalSetting.Instance.AuthToken;
179+
178180
await NavigationService.NavigateToAsync<MainViewModel>();
179181
await NavigationService.RemoveLastFromBackStackAsync();
180182
}
@@ -211,6 +213,12 @@ private void Logout()
211213
// Logout
212214
LoginUrl = logoutRequest;
213215
}
216+
217+
if(ViewModelLocator.Instance.UseMockService)
218+
{
219+
Settings.AuthAccessToken = string.Empty;
220+
Settings.AuthIdToken = string.Empty;
221+
}
214222
}
215223

216224
private async void NavigateAsync(string url)

0 commit comments

Comments
 (0)