ueberauth_auth0 icon indicating copy to clipboard operation
ueberauth_auth0 copied to clipboard

Pass organization_name and invite parameters during the redirect

Open hexedpackets opened this issue 3 years ago • 1 comments

As described in #185, the invitation parameter needs to be passed to the Auth0 redirect for organization invites.

I also added the organization_name, which is an optional parameter.

hexedpackets avatar Mar 27 '22 16:03 hexedpackets

Thanks for the pull request @hexedpackets 😻

From the Auth0 documentation (and quote of the corresponding text, emphasis mine): https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members#configure-the-uri

The route in your application must accept invitation and organization parameters through the query string. To start the invitation acceptance transaction, it should forward both parameters along with the end-user to your Auth0 /authorize endpoint.

To support multi-tenant scenarios where the organization name is used as a subdomain or path variable in your application (for example, acme.myapp.com), an organization_name parameter is also included in the invitation link sent to users. This parameter does not need to be sent to /authorize.

For example, if you have an organization-enabled application with an Application Login URI set to https://myapp.com/login, then the link sent in the email invitation that an end-user receives will be: https://myapp.com/login?invitation={invitation_ticket_id}&organization={organization_id}&organization_name={organization_name}.

Your application should initiate a transaction to /authorize that contains the provided invitation and organization key-value pairs.

Question: from what I'm reading on the auth0 docs, there's no need to forward the organization_name parameter. Should we include it in this change ?

achedeuzot avatar Jun 25 '22 22:06 achedeuzot