auth0-react icon indicating copy to clipboard operation
auth0-react copied to clipboard

Organization name still not supported 2.2.1

Open weisssean opened this issue 3 years ago • 2 comments

Checklist

  • [X] The issue can be reproduced in the auth0-react sample app (or N/A).
  • [X] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • [X] I have looked into the API documentation and have not found a suitable solution or answer.
  • [X] I have searched the issues and have not found a suitable solution or answer.
  • [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • [X] I agree to the terms within the Auth0 Code of Conduct.

Description

We are using v2.2.1 and organization name still does not seem to be supported although the documentation says it does.

When using the organization ID everything works, but when using the organization name it's returning invalid request: http://localhost:3000/?error=invalid_request&error_description=authorization%20request%20parameter%20organization%20must%20be%20an%20organization%20id&state=T1N2Q3BSdi1wT1YwU1RjZGRRUWxadEhpVFVyMEppSDlqUGpZQVFmRTBMUg%3D%3D

Reproduction

Build a sample app:

<Auth0Provider domain="yourclient.auth0.com" clientId="" authorizationParams={{ organization: "", redirectUri: window.location.origin, }} <React.StrictMode> </React.StrictMode>

Expected result: shows a popup for the organization result: http://localhost:3000/?error=invalid_request&error_description=authorization%20request%20parameter%20organization%20must%20be%20an%20organization%20id&state=T1N2Q3BSdi1wT1YwU1RjZGRRUWxadEhpVFVyMEppSDlqUGpZQVFmRTBMUg%3D%3D

Additional context

No response

auth0-react version

2.2.1

React version

18.2.0

Which browsers have you tested in?

Chrome

weisssean avatar Sep 21 '23 18:09 weisssean

It looks like auth0 is returning an error indicating it expects an id (see error_description). That means your tenant isnt configured to accept organization names, and isn't something we can solve on the SDK side.

Can you try ensuring that it's enabled in your tenant and try again?

frederikprijck avatar Sep 21 '23 21:09 frederikprijck

Not a bug: I found my issue, in your tenant advanced settings you need to enable this option. It will save a lot of people a lot of time if you add it to the documentation as it is required for this to work.

weisssean avatar Sep 21 '23 21:09 weisssean