Using Auth0 as Social Login for another Auth0 account

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.

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.

2 Likes

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:
  • 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.

1 Like

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:

{
  "error": "invalid_request",
  "error_description": "Invalid user id."
}
1 Like

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

1 Like

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