|
21 | 21 | ``oauth_client_id`` / ``oauth_redirect_port`` overriding it) is |
22 | 22 | forwarded to the kernel's ``auth_type='oauth-u2m'`` and the kernel |
23 | 23 | runs the browser flow itself. |
24 | | -- **Azure Entra (Azure AD)** — both Azure auth types forward the selector |
25 | | - and Azure credentials to the KERNEL, which is the Azure-aware auth core |
26 | | - (it owns the endpoints, scopes, app ids, and tenant discovery). The |
27 | | - binding stays thin — it does not construct endpoints or scopes: |
28 | | -
|
29 | | - - ``azure-oauth`` (U2M) → forward ``auth_type='azure-oauth'`` (plus any |
30 | | - optional ``oauth_client_id`` / ``oauth_redirect_port`` passthrough). The |
31 | | - kernel pins the workspace v2.0 authorize/token endpoints, the Azure app |
32 | | - client id (``96eecda7-…``), port ``8030``, and the |
33 | | - ``{app_id}/user_impersonation offline_access`` scope (PECOBLR-4120). |
| 24 | +- **Azure Entra (Azure AD)** — the KERNEL is the Azure-aware auth core (it |
| 25 | + owns the endpoints, scopes, app ids, and tenant discovery); the binding |
| 26 | + forwards the selector + credentials and does not construct endpoints: |
| 27 | +
|
| 28 | + - ``azure-oauth`` (U2M) → **not supported on the kernel path**; rejected with |
| 29 | + a pointer to ``databricks-oauth``, whose in-house U2M browser flow works |
| 30 | + against Azure workspaces (the workspace federates login to Entra). A |
| 31 | + dedicated Azure U2M flow may return later (PECOBLR-4120). |
34 | 32 | - ``azure-sp-m2m`` (M2M) → forward ``auth_type='azure-sp-m2m'`` with the |
35 | 33 | Azure service-principal ``azure_client_id`` / ``azure_client_secret``. |
36 | 34 | The kernel builds the Entra v2.0 token endpoint and the |
@@ -170,9 +168,10 @@ def kernel_auth_kwargs( |
170 | 168 | - a U2M ``auth_type`` (``databricks-oauth``) *and* |
171 | 169 | ``oauth_client_secret`` together. |
172 | 170 |
|
173 | | - (The Azure Entra auth types — ``azure-oauth`` and ``azure-sp-m2m`` — |
174 | | - are forwarded to the kernel's Azure-aware flows up front, before these |
175 | | - guards; see the module docstring.) |
| 171 | + (The Azure Entra auth types are handled up front, before these guards: |
| 172 | + ``azure-sp-m2m`` forwards to the kernel's Azure SP flow; ``azure-oauth`` |
| 173 | + is rejected with a pointer to ``databricks-oauth``. See the module |
| 174 | + docstring.) |
176 | 175 | 1. **OAuth M2M** — ``oauth_client_id`` + ``oauth_client_secret`` |
177 | 176 | both present → forward raw creds to the kernel's ``oauth-m2m``. |
178 | 177 | 2. **PAT** — the built provider is (or wraps) an |
@@ -211,24 +210,20 @@ def kernel_auth_kwargs( |
211 | 210 | # creds in azure_* kwargs, not oauth_client_id/secret, so it would |
212 | 211 | # otherwise fall through to the final "unsupported" error). |
213 | 212 |
|
214 | | - # azure-oauth (Azure AD U2M): forward the selector; the KERNEL owns Azure |
215 | | - # resolution (it is the auth core). The kernel pins the workspace v2.0 |
216 | | - # authorize/token endpoints (`{host}/oidc/oauth2/v2.0/{authorize,token}` — |
217 | | - # NOT the discovered `/oidc/v1/authorize`, which the workspace redirects to |
218 | | - # a malformed Entra URL), the Azure app client id, port 8030, and the |
219 | | - # `{app_id}/user_impersonation offline_access` scope. So this binding does |
220 | | - # NOT construct endpoints/scopes — it just passes `auth_type='azure-oauth'` |
221 | | - # plus any optional client_id / redirect_port passthrough. PECOBLR-4120. |
| 213 | + # azure-oauth (Azure AD U2M) is NOT supported on the kernel path. The |
| 214 | + # in-house `databricks-oauth` browser flow works against Azure workspaces |
| 215 | + # (the workspace federates the login to Entra), so it is the U2M path on the |
| 216 | + # kernel — reject `azure-oauth` with a clear pointer rather than silently |
| 217 | + # changing the user's selected flow. (A dedicated Azure U2M flow may return |
| 218 | + # later; for now Azure U2M = `databricks-oauth`.) |
222 | 219 | if auth_type == "azure-oauth": |
223 | | - kwargs = {"auth_type": "azure-oauth"} |
224 | | - if client_id: |
225 | | - kwargs["client_id"] = client_id |
226 | | - redirect_port = opts.get("oauth_redirect_port") |
227 | | - if redirect_port is not None: |
228 | | - kwargs["redirect_ports"] = [_coerce_redirect_port(redirect_port)] |
229 | | - if federation_client_id: |
230 | | - kwargs["identity_federation_client_id"] = federation_client_id |
231 | | - return kwargs |
| 220 | + raise NotSupportedError( |
| 221 | + "auth_type='azure-oauth' is not supported on use_kernel=True. Use " |
| 222 | + "auth_type='databricks-oauth' instead — the in-house OAuth U2M " |
| 223 | + "browser flow works against Azure Databricks workspaces (the " |
| 224 | + "workspace federates the login to Microsoft Entra). Or use the " |
| 225 | + "Thrift backend (default) for the dedicated Azure AD U2M flow." |
| 226 | + ) |
232 | 227 |
|
233 | 228 | # azure-sp-m2m (Azure service principal, client-credentials): forward the |
234 | 229 | # selector + Azure SP credentials; the KERNEL owns Azure resolution (it is |
|
0 commit comments