feat: add support for enterprise connect - #167
Open
rmad17 wants to merge 11 commits into
Open
Conversation
…le section to allowlist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Added
ServerClient(enterprise_connect=True)for embedded Enterprise Connect login. Auth0 acts as a pure SSO relay: it authenticates the user through their company identity provider and returns verified claims, issues no refresh token, and holds no session. The application owns the session. Early Access.start_enterprise_login(StartEnterpriseLoginOptions), which runs WebFinger discovery on the email domain and returns an authorization URL withlogin_hintwhen the domain is managed, orNonewhen it is not. Also adds a standalone, statelessis_federated_domain(domain, email_domain)helper exported fromauth0_server_python.auth_server.complete_interactive_login()in Enterprise Connect mode returns a dict{user, token_set, id_token, domain, app_state?}(verified claims plus the one-time access token) instead of persisting a session. PKCE andstateare enforced on the code exchange, as in every other interactive login.mfa/passwordlessproperties) to raiseEnterpriseConnectErrorin this mode. The guard is the first statement in each member and fires before any argument is used or any network call is made. It is a verified no-op when the flag is off.EnterpriseConnectErrorwith a single stable codeEnterpriseConnectErrorCode.NOT_SUPPORTED = "enterprise_connect_not_supported", and theStartEnterpriseLoginOptionsoption model.federatedtoLogoutOptionsand the logout URL builder, which appendsfederated=trueto the Auth0 logout URL. Enterprise Connect logout should be federated: a non-federated logout leaves the enterprise identity provider session live, so the next login silently re-authenticates. Federated logout also ends the user's session at other apps that share the same enterprise SSO.org_idfrom the verified claims but does not enforce it. Organization validation is the application's authorization decision, documented in the guide. Flagging for reviewer visibility - the SDK does not enforce organization membership in this mode by design.offline_accessscope or a staticorganizationis set in Enterprise Connect mode, since neither applies without a refresh token or with IdP-resolved organizations.enterprise_connect=True(default off).Testing
Checklist