# Using Auth0 as Social Login for another Auth0 account

**URL:** <https://community.auth0.com/t/using-auth0-as-social-login-for-another-auth0-account/79716>\
**Category:** Get Help\
**Tags:** social-provider, auth0\
**Created:** [March 11, 2022, 12:28pm UTC](https://community.auth0.com/t/using-auth0-as-social-login-for-another-auth0-account/79716 "2022-03-11T12:28:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![auth\_cutradition](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/auth_cutradition/32/34077_2.png) [@auth\_cutradition](https://community.auth0.com/u/auth_cutradition)\
**Post date:** [March 11, 2022, 12:28pm UTC](https://community.auth0.com/t/using-auth0-as-social-login-for-another-auth0-account/79716/1 "2022-03-11T12:28:19Z")

</div>

Hi,

I have a specific use-case where I have two separate Auth0 accounts (e.g. Company A and Company B), and I want to add one of them as a Custom Social Login option in the other one. So for example:

- User opens Company A login page (built with Auth0)
- User clicks on “Login with Company B” social login button
- User gets redirected to Company B login page (also built with Auth0)
- After login, user will be logged-in and redirected to Company A website

I tried using one account’s Client ID and Secret in the other one as a custom social provider but it didn’t work. Now my question is, is this even possible?

Thanks in advance for your help.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 11, 2022, 6:13pm UTC](https://community.auth0.com/t/using-auth0-as-social-login-for-another-auth0-account/79716/3 "2022-03-11T18:13:37Z")

</div>

Hi @auth_cutradition,

Welcome to the Auth0 Community!

Yes, this should be possible. What isn’t working? How have you configured it?

You can also DM me your tenant name and I will take a look.

---

<div class="post-metadata">

**Author:** ![auth\_cutradition](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/auth_cutradition/32/34077_2.png) [@auth\_cutradition](https://community.auth0.com/u/auth_cutradition)\
**Post date:** [March 14, 2022, 7:40am UTC](https://community.auth0.com/t/using-auth0-as-social-login-for-another-auth0-account/79716/4 "2022-03-14T07:40:33Z")

</div>

Thanks Dan! Here’s how I configured it:

- The first tenant is the main login page, and the second one is the one I want to use as social login option
- I have two apps in my second tenant (one of them is M2M) and I tried the following with both of them:
- In first tenant I created a Custom Social Connection and added the following information:
  - Authorization URL: [https://SECOND-TENANT.eu.auth0.com/oauth/authorize](https://SECOND-TENANT.eu.auth0.com/oauth/authorize)
  - Token URL: [https://SECOND-TENANT.eu.auth0.com/oauth/token](https://SECOND-TENANT.eu.auth0.com/oauth/token)
  - Scope: public
  - Client ID and Client Secret from the second tenant app

- Then I enabled the apps I want to use in first tenant and saved everything
- Now when I click try connection, it says: `The client with id "XXX" (oauth) was not found`
- However I double-checked Client ID and it is correct

I will send my tenant names to you.

---

<div class="post-metadata">

**Author:** ![auth\_cutradition](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/auth_cutradition/32/34077_2.png) [@auth\_cutradition](https://community.auth0.com/u/auth_cutradition)\
**Post date:** [March 14, 2022, 8:03am UTC](https://community.auth0.com/t/using-auth0-as-social-login-for-another-auth0-account/79716/5 "2022-03-14T08:03:46Z")

</div>

OK, it seems that the Auth URL was wrong. I used `https://SECOND-TENANT.eu.auth0.com/authorize` (the same URL, but without `oauth`) and now the login shows-up. Also I had to use the non-M2M app in order for it to work. However after login, I receive the following error:

```auto
{
  "error": "invalid_request",
  "error_description": "Invalid user id."
}

```

---

<div class="post-metadata">

**Author:** ![auth\_cutradition](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/auth_cutradition/32/34077_2.png) [@auth\_cutradition](https://community.auth0.com/u/auth_cutradition)\
**Post date:** [March 14, 2022, 10:00am UTC](https://community.auth0.com/t/using-auth0-as-social-login-for-another-auth0-account/79716/6 "2022-03-14T10:00:37Z")

</div>

I was able to fix the problem by modifying the `Fetch User Profile Script` mentioned here in the docs:

[https://auth0.com/docs/authenticate/identity-providers/social-identity-providers/oauth2#fetch-user-profile-script](https://auth0.com/docs/authenticate/identity-providers/social-identity-providers/oauth2#fetch-user-profile-script)

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 14, 2022, 4:43pm UTC](https://community.auth0.com/t/using-auth0-as-social-login-for-another-auth0-account/79716/7 "2022-03-14T16:43:04Z")

</div>

Thanks for providing all of this context! I’m glad you were able to get it working 😄

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 22, 2022, 12:01am UTC](https://community.auth0.com/t/using-auth0-as-social-login-for-another-auth0-account/79716/8 "2022-04-22T00:01:40Z")

</div>


