0
votes

I'm using Xamarin Forms with Auth0. Backend is Azure Mobile Application (not Azure Mobile Service) where database is not tied in.

My authentication works fine in Android. I'm just not sure how to pass this info to backend service, once this is done :

    public static MobileServiceClient client = new MobileServiceClient (
        Constants.applicationURL, Constants.gatewayURL,
        Constants.applicationKey);

    public async void Login()
    {
            await DependencyService.Get<LoginApp.IAuth0WidgetLogin>().LoginUseAuth0EmbeddedWidget();
            App.client.CurrentUser = User.UserName;
            App.client.CurrentUser.MobileServiceAuthenticationToken = User.jwt;

    }

Examples given by Auth0 is at table level permission with some scripting for each table in Azure portal. But my database is not tied in there.

I would instead prefer some code like this.

It would be best if can get back user profile in backend service, so I could user the name to perform audit logs. Maybe using delegation token

var api = await auth0.GetDelegationToken("{THE WAMS CLIENT ID IN AUTH0}");
1

1 Answers

0
votes

Are you talking about trying to get a user's Facebook data after they have been authenticated? If so, what I have done is add a custom API endpoint that I can call after the user has been authenticated. Because the call would be made from an authenticated MobileServiceClient object, no further authentication would be needed and your API can call directly to Facebook, Twitter, etc. APIs. From one of those calls, you can get the users username, pictures, etc.