Register your app to use Microsoft account for authentication
This is an Azure Mobile Services topic. Microsoft Azure recommends Azure App Service Mobile Apps for all new mobile backend deployments. To get started with Azure App Service Mobile Apps, see the App Service Mobile Apps documentation center.
This topic shows you how to register your mobile app to be able to use Microsoft account as an identity provider with Azure Mobile Services. The same steps apply for both service-directed authentication and client-directed authentication using the Live SDK.
Windows Store apps must first be registered with the Windows Dev Center.
If you have not already registered your app, navigate to the Windows Dev Center, log on with your Microsoft account, type a name for your app, then click Reserve app name.
Open your Windows app project in Visual Studio, then in Solution Explorer right-click the Windows Store app project, click Store > Associate App with the Store....
In the wizard, click Sign in and sign-in with your Microsoft account, select the app name you reserved, then click Next > Associate.
(Optional) For a universal Windows 8.1 app, repeat steps 4 and 5 for the Windows Phone Store project.
Back in the Windows Dev Center page for your new app, click Services > Push notifications.
In the Push notifications page, click Live Services site under Windows Push Notification Services (WNS) and Microsoft Azure Mobile Services.
This displays the Microsoft account page for your app. Next, you will get the authentication credentials that Azure needs to use Microsoft authentication with your app.
The first step in this section applies only to Windows Phone 8, Windows Phone 8.1 Silverlight, and non-Windows Store apps. For these apps, you can also ignore the Package security identifier (SID), which is only available for Windows Store apps.
For a non-Windows Store app, navigate to the My Applications page in the Microsoft account Developer Center, log on with your Microsoft account (if required), click Create application, type an Application name, then click I accept.
This reserves you app name with Microsoft account and displays the Microsoft account page for your app.
In the Microsoft account page for your app, click API Settings, enable Mobile or desktop client app, set the mobile service URL as the Target domain, then supply one of the following URL formats in Redirect URL and click Save:
- .NET backend:
Make sure that you use the correct redirect URL path format for your type of Mobile Services backend. When this is incorrect, authentication will not succeed. The Root domain should fill in automatically.
- .NET backend:
Click App Settings and make a note of the values of the Client ID, Client secret and Package SID.
In the Azure classic portal, click the Identity tab for the mobile service, enter the client ID, client secret and package SID obtained from your identity provider, then click Save.
Both your mobile service and your app are now configured to work with Microsoft account.