Determine current tenant within fetch user profile script

I am creating a custom social connection, and working on the Fetch User Profile Script. I have two different auth0 tenants and would like to use the same Fetch User Profile Script in both, with logic inside the script to do slightly different things depending on the current tenant. Is there a way to determine the auth0 tenant of context within the Fetch User Profile Script?

Hey there @jkay!

Does context.tenant work for your needs?

It doesn’t look like the context object has a tenant property on it. Here is the structure of that object inside of the event:

{
    "id_token": "stringValue",
    "options": {
        "authorizationURL": "stringValue",
        "client_id": "stringValue",
        "client_secret": "stringValue",
        "scope": "stringValue",
        "store": {
        },
        "tokenURL": "stringValue"
    },
    "token_type": "stringValue"
}
1 Like

Hmm… does the authorizationUrl not tell you which tenant is used? I suppose you could also deduce from the client_id?

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