How to create & link social accounts with organizations?

nik.baleca
Thu, 22 Jan 2026 18:35:06 +0000

Got it, thanks for the additional info.

Can you try the following approach in your implementation since you are using organizations?

Once the user clicks Link Github, redirect them manually to the /authorize endpoint and use response_mode=query and a specific redirect_uri for linking. An example of such an authorize call using JS would be:

const linkRedirectUri = 'https://yourapp.com/link-callback';
const primaryUserId = 'USER_ID_FROM_CURRENT_SESSION';

const authorizeUrl = "https://YOUR_AUTH0_DOMAIN/authorize?
client_id=YOUR_CLIENT_ID&
connection=github&
redirect_uri=${linkRedirectUri}&
response_type=code&
scope=openid profile email&
state=${primaryUserId}"

window.location.assign(authorizeUrl);

Once the user is redirected back to the callback route, the URL will contain a code and state. You will need to send the code to your backend in order to exchange it for a token against the /oauth/token endpoint in order to receive the Access and Id Tokens for the respective users.

You can either decode the token or call the /userinfo endpoint to retrieve the sub claim of the github user

Now, you should be able to make a call to the Management API to link the users or proceed to link the users

Let me know if the proposed solution helps you with the issue or not!

Kind Regards,
Nik