cltsang
cltsang

Reputation: 1829

Azure Mobile Services authentication client flow hook

I'm using .NET backend on Azure Mobile Service. It's easy to set up authentication with social identity provider, so that the client can use e.g. Facebook iOS SDK to login, as illustrated in the official tutorial

In custom authentication, as I need to maintain my own Account table according to the official tutorial, I have full control over the registration & login.

I'd like to have a centralized User table to store information about all users, no matter which channel they used to authenticate.

My question is, is there a way for the .NET backend to be notified when a user register or login with a Facebook token? So that a new row can be added to the centralized User table even when the user is using Facebook to authenticate?

Thank you!

Upvotes: 1

Views: 93

Answers (1)

Adrian Hall
Adrian Hall

Reputation: 8035

Yes - the User.GetIdentities() method contains the token and mechanism that was used to authenticate the user. You can use this to update your table. For an overview of how to use this token, see this blog post by the team: https://azure.microsoft.com/en-us/blog/custom-login-scopes-single-sign-on-new-asp-net-web-api-updates-to-the-azure-mobile-services-net-backend/

Upvotes: 2

Related Questions