I think I found the base solution for a problem I have, it’s the same as in “Unable to authorized with the custom domain” BUT I’m not using the Management API directly, I’m using the gem auth0. I’m not sure about the code I need to add to change the audience on my case.
How can I change the audience using the “gem”. My current code looks like:
...
authInfo = auth0_client.user(userId)
...
def auth0_client
Auth0Client.new(
client_id: ENV['AUTH0_CLIENT_ID'],
client_secret: ENV['AUTH0_CLIENT_SECRET'],
domain: ENV['AUTH0_DOMAIN'], # Like auth.mydomain.com
api_version: 2,
timeout: 5
)
end
I’m not sure how to specify both domains, the custom one and the auth0 default (as stated in the answer Unable to authorized with the custom domain - #3 by kimcodes). Maybe is not in the initializer but in another method to add extra headers, perhaps like this?:
...
authInfo.add_headers( audience: ENV['AUTH0_DEFAULT_DOMAIN'] ) # Like mydomain.auth0.com
...