Current Position:Home > Login to WebApi (MVC + WebApi) with Microsoft Account from Windows Store App

Login to WebApi (MVC + WebApi) with Microsoft Account from Windows Store App

Update:10-11Source: network consolidation
Advertisement
Hi
How can I access a WebApi Controller (ASP.NET MVC+WebApi) that is secured with Microsoft Account from a Windows Store App?
I have no idea how to login. I tried the LiveSDK but this gives me only access to OneDrive, Callender and so on.
Could someone please point me in the right direction.
Thanks
Guenter

The Best Answer

Advertisement
Hi Guenter,
To be clear, you are using Microsoft account as login and at same time you have your own REST service for other functionalities?
Let's say if you login with LiveSDk, you should be able to get some access token, see this for more information:
Signing users in, after that use the token to access your REST service, as I understand REST service is a kind of http request, we can use HTTPClient to request data from the address.
I'm afraid there is no existing sample here but the only thing I found is HTTPClient sample:
https://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664, you can use POST to send your token information to the server.
--James
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.