Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK-2405] Organisations support #343

Merged
merged 5 commits into from
Mar 18, 2021
Merged

[SDK-2405] Organisations support #343

merged 5 commits into from
Mar 18, 2021

Conversation

adamjmcgrath
Copy link
Contributor

Description

Add support for Organisations (currently a Closed Beta)

  • supports an organization config or AUTH0_ORGANIZATION environment variable which, when specified, passes the organization query param to the /authorize endpoint and validates it against the user's org_id ID Token claim.
  • Allows the organization query param to be specified in the loginHandler and callbackHandler so that app's can support multiple Organzations.
  • Document the invitation query parameter for the /authorize endpoint and add an example of creating a route that accepts Organization invites.

@adamjmcgrath adamjmcgrath added the review:medium Medium review label Mar 17, 2021
@adamjmcgrath adamjmcgrath requested a review from a team as a code owner March 17, 2021 11:15
@vercel
Copy link

vercel bot commented Mar 17, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/auth0/nextjs-auth0/B5dKzs5isMrjRrufWbNzN3n72JtK
✅ Preview: Canceled

[Deployment for 0077fe7 canceled]

Copy link

@stevehobbsdev stevehobbsdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@adamjmcgrath adamjmcgrath merged commit 53075fc into main Mar 18, 2021
@adamjmcgrath adamjmcgrath deleted the organisations branch March 18, 2021 10:28
@adamjmcgrath adamjmcgrath mentioned this pull request Mar 26, 2021
@eluce2
Copy link

eluce2 commented Oct 22, 2021

Can I see an example of this working? I've only implemented the basic configuration

// pages/api/auth/[...auth0].js
import { handleAuth } from "@auth0/nextjs-auth0";

export default handleAuth();

but when I call /api/auth/login?organization=orgId123 I get the following response:

invalid_request (parameter organization is required for this client)

And I can see from the auth0 logs that my query param was not passed through. What am I missing?

@adamjmcgrath
Copy link
Contributor Author

Hi @eluce2

You can specify the AUTH0_ORGANIZATION=orgId123 environment variable or pass it as a custom option to handleLogin and handleCallback (see this example for passing custom authorization parameters https://github.com/auth0/nextjs-auth0/blob/main/EXAMPLES.md#customize-handlers-behavior)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:medium Medium review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants