Not able to login with facebook

I am trying out Auth0. I have created machine-to-machine application. The idea is to have a mobile app use our own developed REST API. These REST APIs will invoke the Auth0 APIs.
But I get this error when I try Facebook login. I dont see any “Enable Sign In with Facebook” option in this machine to machine application. Also to test I created another “Native” application. and in that the “Enable Sign In with Facebook” toggle is there, but it is disabled.
Please suggest how should I proceed.
The error I get is :
{
“error”: “unauthorized_client”,
“error_description”: “Grant type urn:ietf:params:oauth:grant-type:token-exchange with subject_token_type http://auth0.com/oauth/token-type/facebook-info-session-access-token is not enabled for this client”
}

The API I invoked is:
curl --location --request POST ‘https://dev-bd9vtd3b.us.auth0.com/oauth/token
–header ‘Content-Type: application/x-www-form-urlencoded’
–data-urlencode ‘grant_type=urn:ietf:params:oauth:grant-type:token-exchange’
–data-urlencode ‘subject_token=…’
–data-urlencode ‘client_id=DH…Fs’
–data-urlencode ‘client_secret=…’
–data-urlencode ‘subject_token_type=http://auth0.com/oauth/token-type/facebook-info-session-access-token’
–data-urlencode ‘user_profile={“email”:"…", “name”:"…"}’
–data-urlencode ‘scope=openid profile email offline_access update:current_user_identities’

Hi @kiran.ms

To get native facebook login on your app you’ll need to enable the toggle in your Auth0 application’s device settings, as shown here: Add Facebook Login to Native Apps

1 Like

Thank you for quick reply.
But for “Machine to Machine” application, I dont see this option at all.
And for the “Native” application, I see it, but it is disabled. I cant toggle it.

@ricardo.batista I see this screen for “Machine to Machine” application:

And this for “Native” application. But here the toggle is not working, it is disabled.

I see some javascript error when I click on this toggle button.

Uncaught TypeError: Cannot read property ‘sanitize’ of undefined
at t.e.isValid (main.js:1)
at Object.updateModel [as client.native_social_login.facebook] (main.js:1)
at main.js:1
at M.createElement.NE.onChange (main.js:1)
at onChange (vendor.js:1)
at Object. (vendor.js:1)
at p (vendor.js:1)
at vendor.js:1
at w (vendor.js:1)
at A (vendor.js:1)
at Array.forEach ()
at C (vendor.js:1)
at I (vendor.js:1)
at On (vendor.js:1)
at Is (vendor.js:1)
at Le (vendor.js:1)
at An (vendor.js:1)
at vendor.js:1
at Object.t.unstable_runWithPriority (vendor.js:1)
at Ds (vendor.js:1)
at xn (vendor.js:1)
at HTMLDocument.sentryWrapped (helpers.ts:77)

Thanks for reporting it. Let me check internally with the team.

1 Like

Thanks. Wanted to know one thing:

  1. Is Native Facebook login not supported in “Machine to Machine Applications”? Because I dont see the “Enable Sign In with Facebook” option in dashboard for this type of applications.

Yes, the “Enable Sign in with Facebook” is only available for Native apps, since it requires the Android or IOS Facebook SDK, as stated here: Add Facebook Login to Native Apps

In the meantime, you can still update your application by using the management API. You can use the PATCH /api/v2/clients/{id} with the following payload:

{
   "native_social_login": {
     "facebook": {
       "enabled": true
     }
   }
}
1 Like

Thanks @ricardo.batista

1 Like

We are here for you Kiran! Thanks for helping on this one Ricardo!

So if we are developing a proxy API which accepts requests from mobile application (mobile app has social login also) and then invokes the Auth0 APIs, then we need to have one “Machine to Machine Application” to generate management token and one “native” application for each mobile app.
Is my understanding correct?
@konrad.sopala @ricardo.batista

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