Register your app to use Microsoft account for authentication
This is an Azure Mobile Services topic. This service has been superceded by Azure App Service Mobile Apps. We recommend using Azure Mobile Apps for all new mobile backend deployments. You should consider migrating your site to Azure App Service.
To get started with Azure Mobile Apps, see the Azure 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. By registering, your Windows app will be able to use single sign-on behaviors.
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 app settings page for your app.
Make a note of the Package SID value. You can save this SID in the Azure portal to both enable single sign-on and push notifications for your Windows app.
Next, you will configure Microsoft account authentication for your Windows app, starting with step 4 in the next section.
If you have already registered your Windows app in the previous section, you can skip to step 2.
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.