# Not able to login with facebook

**URL:** <https://community.auth0.com/t/not-able-to-login-with-facebook/60236>\
**Category:** Get Help\
**Tags:** facebook-login, facebook\
**Created:** [March 29, 2021, 12:37pm UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236 "2021-03-29T12:37:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran.ms](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.ms/32/28442_2.png) [@kiran.ms](https://community.auth0.com/u/kiran.ms)\
**Post date:** [March 29, 2021, 12:37pm UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/1 "2021-03-29T12:37:10Z")

</div>

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](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](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](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’

---

<div class="post-metadata">

**Author:** ![ricardo.batista](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ricardo.batista/32/7711_2.png) [@ricardo.batista](https://community.auth0.com/u/ricardo.batista)\
**Post date:** [March 29, 2021, 1:23pm UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/2 "2021-03-29T13:23:41Z")

</div>

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: [https://auth0.com/docs/connections/nativesocial/facebook](https://auth0.com/docs/connections/nativesocial/facebook)

---

<div class="post-metadata">

**Author:** ![kiran.ms](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.ms/32/28442_2.png) [@kiran.ms](https://community.auth0.com/u/kiran.ms)\
**Post date:** [March 29, 2021, 1:45pm UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/3 "2021-03-29T13:45:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kiran.ms](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.ms/32/28442_2.png) [@kiran.ms](https://community.auth0.com/u/kiran.ms)\
**Post date:** [March 29, 2021, 1:47pm UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/4 "2021-03-29T13:47:12Z")

</div>

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

 ![image](https://global.discourse-cdn.com/auth0/original/3X/f/c/fc9a03cb801570708f19ba415b795adbc653f520.png)

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

 ![image](https://global.discourse-cdn.com/auth0/original/3X/0/8/081b6b6b39b95f8b498bd7e704c6a8cfd2dddcf4.png)

---

<div class="post-metadata">

**Author:** ![kiran.ms](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.ms/32/28442_2.png) [@kiran.ms](https://community.auth0.com/u/kiran.ms)\
**Post date:** [March 30, 2021, 6:45am UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/5 "2021-03-30T06:45:58Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![ricardo.batista](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ricardo.batista/32/7711_2.png) [@ricardo.batista](https://community.auth0.com/u/ricardo.batista)\
**Post date:** [March 30, 2021, 9:04am UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/6 "2021-03-30T09:04:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kiran.ms](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.ms/32/28442_2.png) [@kiran.ms](https://community.auth0.com/u/kiran.ms)\
**Post date:** [March 30, 2021, 9:23am UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/7 "2021-03-30T09:23:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ricardo.batista](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ricardo.batista/32/7711_2.png) [@ricardo.batista](https://community.auth0.com/u/ricardo.batista)\
**Post date:** [March 30, 2021, 12:54pm UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/8 "2021-03-30T12:54:21Z")

</div>

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: [https://auth0.com/docs/connections/nativesocial/facebook](https://auth0.com/docs/connections/nativesocial/facebook)

In the meantime, you can still update your application by using the management API. You can use the [PATCH /api/v2/clients/{id}](https://auth0.com/docs/api/management/v2#!/Clients/patch_clients_by_id) with the following payload:

```
{
   "native_social_login": {
     "facebook": {
       "enabled": true
     }
   }
}

```

---

<div class="post-metadata">

**Author:** ![kiran.ms](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.ms/32/28442_2.png) [@kiran.ms](https://community.auth0.com/u/kiran.ms)\
**Post date:** [March 31, 2021, 5:53am UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/9 "2021-03-31T05:53:36Z")

</div>

Thanks @ricardo.batista

---

<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:** [March 31, 2021, 10:29am UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/10 "2021-03-31T10:29:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kiran.ms](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.ms/32/28442_2.png) [@kiran.ms](https://community.auth0.com/u/kiran.ms)\
**Post date:** [March 31, 2021, 11:04am UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/11 "2021-03-31T11:04:14Z")

</div>

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

---

<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:** [April 15, 2021, 11:04am UTC](https://community.auth0.com/t/not-able-to-login-with-facebook/60236/12 "2021-04-15T11:04:28Z")

</div>

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