<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: OAuth Url and ClientId Validation in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/oauth-url-and-clientid-validation/m-p/109745#M2972</link>
    <description>&lt;P&gt;RFC for the reference&amp;nbsp;&lt;A href="https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1" target="_blank"&gt;https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Feb 2025 09:55:05 GMT</pubDate>
    <dc:creator>Leo_310</dc:creator>
    <dc:date>2025-02-11T09:55:05Z</dc:date>
    <item>
      <title>OAuth Url and ClientId Validation</title>
      <link>https://community.databricks.com/t5/administration-architecture/oauth-url-and-clientid-validation/m-p/109738#M2971</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to setup an oauth connection with databricks, so I ask the user to enter their Workspace URL and ClientId.&lt;/P&gt;&lt;P&gt;Once the user enters these values, I want to validate whether they are correct or not, so I ask them to login by redirecting them to the authorize Url.&lt;/P&gt;&lt;P&gt;If Workspace URL is correct but clientId is incorrect, it gets stuck on this window showing client id is incorrect, but it does not return this error back to my Frontend. I tried doing via popup so as to not block my UI, but is there a way to get this error back to Parent window? Maybe add it to URL or something, as other OAuth providers do give some errors/expose endpoints to validate if client id is correct or not.&lt;/P&gt;&lt;P&gt;This way I will be able to tell users more clearly as to what the issue is.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 08:44:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/oauth-url-and-clientid-validation/m-p/109738#M2971</guid>
      <dc:creator>Leo_310</dc:creator>
      <dc:date>2025-02-11T08:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth Url and ClientId Validation</title>
      <link>https://community.databricks.com/t5/administration-architecture/oauth-url-and-clientid-validation/m-p/109745#M2972</link>
      <description>&lt;P&gt;RFC for the reference&amp;nbsp;&lt;A href="https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1" target="_blank"&gt;https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 09:55:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/oauth-url-and-clientid-validation/m-p/109745#M2972</guid>
      <dc:creator>Leo_310</dc:creator>
      <dc:date>2025-02-11T09:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth Url and ClientId Validation</title>
      <link>https://community.databricks.com/t5/administration-architecture/oauth-url-and-clientid-validation/m-p/137468#M4353</link>
      <description>&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If you’re using OAuth with Databricks and want to validate both the Workspace URL and ClientId before proceeding, you’re facing an issue seen by others: when the Workspace URL is correct but the ClientId is wrong, Databricks just displays a generic error (like “invalid client id”) in the popup window and does not pass this error back to your frontend or parent window directly. This makes it difficult to inform users about the exact problem with their credentials.​&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Why the OAuth error isn’t returned to parent&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Most OAuth flows (per RFC6749) redirect errors to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;redirect_uri&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;if one is provided and valid. However, with Databricks, if the ClientId is wrong, the authorization window typically just stops at the error screen without forwarding error information in a URL query string, nor does it send events or messages back to the frontend. This is different from some other OAuth providers that more actively use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;redirect_uri&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to communicate error details.​&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Common workarounds&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;You can use a popup for the OAuth flow to avoid blocking your main UI, but since Databricks does not redirect on some errors, you won’t get callback information using standard mechanisms alone.​&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Some developers set up their own redirect page (hosted on the same domain as the parent app), which attempts to communicate with the opener via&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;window.opener.postMessage()&lt;/CODE&gt;, or by adding error details to URL fragments (e.g.,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;redirect_uri?error=invalid_client&lt;/CODE&gt;). This only works if Databricks redirects even on client errors, which may not be the case for an invalid ClientId with their flow.​&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Other providers do give detailed error codes on the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;redirect_uri&lt;/CODE&gt;, making it much easier to surface and diagnose client-side issues.​&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Possible strategies for better error handling&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Double-check that the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;redirect_uri&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;you register is correct and includes generous error handling code on your side; if Databricks does redirect even on error, you can parse error query params or hash fragments.​&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If the window gets “stuck” and does not redirect, consider polling the popup window for its URL or contents to detect if the error page has loaded, then close the popup and display your own error (although this is hacky and may not always be reliable).​&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Some integrations check the ClientId and Workspace URL by directly calling Databricks’ token endpoint before initiating a full login window; failed requests to this endpoint will return descriptive errors (401, 403, etc.) that you can surface immediately in your UI. This may help you catch errors before involving the user in an interactive OAuth flow.​&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Summary Table&lt;/H2&gt;
&lt;DIV class="group relative"&gt;
&lt;DIV class="w-full overflow-x-auto md:max-w-[90vw] border-subtlest ring-subtlest divide-subtlest bg-transparent"&gt;
&lt;TABLE class="border-subtler my-[1em] w-full table-auto border-separate border-spacing-0 border-l border-t"&gt;
&lt;THEAD class="bg-subtler"&gt;
&lt;TR&gt;
&lt;TH class="border-subtler p-sm break-normal border-b border-r text-left align-top"&gt;OAuth Provider&lt;/TH&gt;
&lt;TH class="border-subtler p-sm break-normal border-b border-r text-left align-top"&gt;Error on Redirect URI&lt;/TH&gt;
&lt;TH class="border-subtler p-sm break-normal border-b border-r text-left align-top"&gt;Error Propagated to Parent&lt;/TH&gt;
&lt;TH class="border-subtler p-sm break-normal border-b border-r text-left align-top"&gt;Notes&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Databricks&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Sometimes, not always​&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Rarely​&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Often gets stuck on error page for clientId issues&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Others&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Usually​&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;Usually with error param&lt;/TD&gt;
&lt;TD class="px-sm border-subtler min-w-[48px] break-normal border-b border-r"&gt;E.g., Google, Auth0, etc.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;DIV class="bg-base border-subtler shadow-subtle pointer-coarse:opacity-100 right-xs absolute bottom-0 flex rounded-lg border opacity-0 transition-opacity group-hover:opacity-100 [&amp;amp;&amp;gt;*:not(:first-child)]:border-subtle [&amp;amp;&amp;gt;*:not(:first-child)]:border-l"&gt;
&lt;DIV class="flex"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="flex"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Recommendations&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Before sending users to OAuth, validate credentials using token endpoint (catch 401s).&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Use a custom redirect page to try to capture errors with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;window.opener.postMessage()&lt;/CODE&gt;.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Watch the popup window for navigation changes and close it if error pages are detected.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Document the clientId validation pitfall for your end-users, so they know what to expect.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;This approach should help you inform users more clearly about issues with their credentials and improve your overall UX.​&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 21:21:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/oauth-url-and-clientid-validation/m-p/137468#M4353</guid>
      <dc:creator>mark_ott</dc:creator>
      <dc:date>2025-11-03T21:21:51Z</dc:date>
    </item>
  </channel>
</rss>

