I have a Xamarin.Forms app, and I'd like to implement its authentication features based on FaceBook and Azure. The authentication itself work, but I have not found the way to get basic user info from it (name, email...)
var user = await DependencyService.Get<IMobileClient>()
.LoginAsync(MobileServiceAuthenticationProvider.Facebook);
On server side
var mobileAppUser = (MobileAppUser)User;
var facebookCredentials =
user.GetIdentityAsync<FacebookCredentials>().Result;
mobileAppUser exists, but facebookCredentials is always null.
My backend on Azure is a new mobile web app written in .net. All of its features working great, except this authentication question. I could not find the proper way to solve this problem on server side or on client side. Pls. note, my question is about the new way of Azure mobile apps, not the old classic one.
Would you be so kind to help me? Any sample code or documentation are warmly welcomed.
Thanks in advance!
It uses the standard OAuth 2.0 client credentials grant. In the Azure portal, select Active Directory > App registrations > New registration.
But again, Azure AD does not support Basic Auth. And in fact, Microsoft is deprecating basic auth for Exchange Online as announced here.
When a user is granted app access via Role-Based Access Control (RBAC) or coadmin permissions, that user can use their own user-level credentials until the access is revoked. Do not share these credentials with other Azure users. App-level credentials: one set of credentials for each app.
Too long for a comment
If you check out the implementation of GetIdentityAsync
, you'll see the following:
"EMA_RuntimeUrl"
from the config (it's not null, because then you'd get an exception)null
. I believe this is the issue you are running into. A quick search on this issue brings you to this SO question.
So have you created an EMA_RuntimeUrl manually in mobile app in azure portal in Application Properties, and assigned to Gateway address?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With