# How do I secure Azure App Service end-point for MobileServiceClient in Xamarin Forms?

**URL:** <https://community.auth0.com/t/how-do-i-secure-azure-app-service-end-point-for-mobileserviceclient-in-xamarin-forms/38309>\
**Category:** Get Help\
**Tags:** nodejs, azure, auth0\
**Created:** [February 22, 2020, 7:52pm UTC](https://community.auth0.com/t/how-do-i-secure-azure-app-service-end-point-for-mobileserviceclient-in-xamarin-forms/38309 "2020-02-22T19:52:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lindsaymiles](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lindsaymiles/32/12931_2.png) [@lindsaymiles](https://community.auth0.com/u/lindsaymiles)\
**Post date:** [February 22, 2020, 7:52pm UTC](https://community.auth0.com/t/how-do-i-secure-azure-app-service-end-point-for-mobileserviceclient-in-xamarin-forms/38309/1 "2020-02-22T19:52:00Z")

</div>

Hello,

Not entirely an Auth0 issue but hoping someone can help!

I have an app that uses Auth0 as the login provider and can login through multiple providers - Facebook, LinkedIn, Google, MS and Apple. This all happens client-side and I get the id and access tokens from the relevant service. No errors.

My app then connects to Azure App Services using the Microsoft.WindowsAzure.MobileServices API  
I use this to create the connection to the service:  
client = new MobileServiceClient([https://mycompany.azurewebsites.net](https://mycompany.azurewebsites.net/));

The app can then sync data between the local SQLite db and my Azure SQL db.  
This all WORKS, no errors.

PROBLEM - the endpoint [https://mycompany.azurewebsites.net](https://mycompany.azurewebsites.net/) is set with anonymous access and is not secured.

I can enable App Service Authentication and implement something like this for most authentication services, passing in the already-received tokens from login:  
task = Task.Run(async () =\> await client.LoginAsync(MobileServiceAuthenticationProvider.Facebook, AccessToken));  
user = task.Result;

This is fine for MS, Facebook and Google authentication BUT there is nothing in the API for LinkedIn or Apple.  
_Apple certification requires and Apple login IF other provider login choices are also made available to the user._

Question:  
How can I secure the Azure App Service in Node.js to accept an app ID and or password or token that I can supply from the client side as constants to simply allow generic but somewhat secure access to this URL: [https://mycompany.azurewebsites.net](https://mycompany.azurewebsites.net/) and NOT have this set with anonymous access?

Can anyone please shed light on this?  
This is a major block in final progress with the app.

Thank you

---

<div class="post-metadata">

**Author:** ![wassimchegham](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/wassimchegham/32/19305_2.png) [@wassimchegham](https://community.auth0.com/u/wassimchegham)\
**Post date:** [February 24, 2020, 11:30am UTC](https://community.auth0.com/t/how-do-i-secure-azure-app-service-end-point-for-mobileserviceclient-in-xamarin-forms/38309/2 "2020-02-24T11:30:33Z")

</div>

Hi @lindsaymiles, there seems to be a doc ([link](https://cda.ms/1dj)) about the best practices on how to secure an app using Azure App service. They provide different strategies for securing your app.

I hope it can help.  
Cheers.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 24, 2020, 11:33am UTC](https://community.auth0.com/t/how-do-i-secure-azure-app-service-end-point-for-mobileserviceclient-in-xamarin-forms/38309/3 "2020-02-24T11:33:38Z")

</div>

Thanks for sharing that link @wassimchegham!

---

<div class="post-metadata">

**Author:** ![lindsaymiles](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lindsaymiles/32/12931_2.png) [@lindsaymiles](https://community.auth0.com/u/lindsaymiles)\
**Post date:** [February 24, 2020, 9:59pm UTC](https://community.auth0.com/t/how-do-i-secure-azure-app-service-end-point-for-mobileserviceclient-in-xamarin-forms/38309/4 "2020-02-24T21:59:52Z")

</div>

Yep, already looked at all that. The sync service seems restrictive in how much it can be extended, especially after authorizing through Auth0 in the client-side app THEN needing to authenticate tokens from the various providers, when accessing the service… kinda stuck right now. Even trying to find ways to pass in an app secret (and handle it) into the sync service isn’t clear.

Any other info, tips, guidance would be most useful.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 10, 2020, 9:59pm UTC](https://community.auth0.com/t/how-do-i-secure-azure-app-service-end-point-for-mobileserviceclient-in-xamarin-forms/38309/5 "2020-03-10T21:59:57Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
