Search code examples
c#authenticationuwpin-app-purchaseazure-mobile-services

How to sign into UWP app with microsoft account?


I am designing a uwp c# app that contains in app purchases. This app will be installed on public systems, so I want the app to pop up with a sign in screen when it starts. I want users to sign in with their microsoft accounts, so that they can make purchases on their account.

I am following the instructions for this at https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-windows-store-dotnet-get-started-users . To sign in with Microsoft, you need to "configure your preferred identity provider" and for microsoft, the instructions are here https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-microsoft .

The second website tells you to add a domain name for your app, But I dont know what that Is.

In Redirect URIs, select Web, and then type https://<app-domain-name>/.auth/login/microsoftaccount/callback supply the endpoint for your application. Replace <app-domain-name> with the domain name of your app. For example, https://contoso.azurewebsites.net/.auth/login/microsoftaccount/callback.

What would be my redirect URI for my app? also, are there any code samples of this so that I can see how it works better?


Solution

  • I've just published updated HOWTO documents for authentication, specifically targetting Microsoft accounts. Take a look at the Quickstart guides for your platform at https://azure.github.io/azure-mobile-apps for details.

    short version - MSA no longer uses Microsoft Account (which is deprecated) - it's done through Azure Active Directory now.