feat: enterprise connect support - #163
Draft
rmad17 wants to merge 6 commits into
Draft
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.
Added
enterprise_connect=True, where Auth0 is a pure SSO relay: it verifies the user at the enterprise IdP and returns claims, but holds no session and issues no refresh token. The app owns the session. Framework-agnostic RWA: no routes, no cookies, needs only atransaction_store. Callback tokens go to the integrator's server, never the browser.start_enterprise_login(options, store_options), the single EC entry point: validates the email, runs WebFinger discovery, and returns an authorize URL withlogin_hintfor a managed domain orNoneotherwise. Only a per-loginorganizationis forwarded — the static client-level org is never auto-applied, so multi-customer deployments aren't all routed to one org.complete_interactive_login. Signature and issuer validation still run first, then it returns{user, token_set, id_token, domain}(plusapp_statewhen set) without persisting a session, and consumes the transaction. RaisesApiError("invalid_response")on no verifiable claims.org_idis surfaced but not validated by the SDK — the domain-based routing to a connection is a hint, not a security control, so validatingorg_idpost-callback is the integrator's responsibility.is_federated_domain(domain, email_domain)and internal_is_federated_domain. Fails closed toFalseon any error or non-200/404, caches in a FIFO store bounded at 1000 (TTL 60s found / 15s not-found), and warns on 429.get_session/get_access_tokenraiseEnterpriseConnectError(enterprise_connect_session_unavailable/enterprise_connect_access_token_unavailable). User linking, connected accounts, session transfer, passkey sign-in, CIBA,login_with_custom_token_exchange, and themfa/passwordlesssub-clients raiseenterprise_connect_method_unavailable.handle_backchannel_logoutis a no-op.logoutappendsfederated=truetohttps://{domain}/v2/logoutwhenLogoutOptions.federatedis set. The local store delete is guarded so an EC client with no store doesn't crash.offline_accessin scope and a staticorganization.StartEnterpriseLoginOptions,LogoutOptions.federated) and errors (EnterpriseConnectError+EnterpriseConnectErrorCode).URL.create_logout_urlgains afederatedflag.