2
votes

I'm looking for the way to extend Azure Mobile Services authentication providers list. To be able to add Instagram, LinkedIn and other OAuth2 providers.

I see an example on how to do it for the .Net back-end using custom LoginProvider class: http://azure.microsoft.com/blog/2014/07/28/azure-mobile-services-net-updates/

But is there a way to do it for Nodejs Azure Mobile Services back-end?

1

1 Answers

1
votes

There is a way to achieve the scenario, but it is not as turnkey as in the .NET backend. It requires some manual work to achieve.

There is not a direct parallel to the LoginProvider, but if you have the ability to log users in and validate the tokens (say via an NPM module), then you could issue your own Mobile Services tokens. A team member wrote a blog post describing how to build your own Mobile Services token. Upon validating the token from the provider you're interested in, you can execute the code described there to return an identity to your client. The JSON payload being returned can be cast on the client to a MobileServiceUser object.

It definitely requires you to take matters a bit more into your own hands, but that's the current pattern availalble to the Node.JS backend.