<?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: Lakebase login via REST for a service principal in Lakebase Discussions</title>
    <link>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155467#M98</link>
    <description>&lt;P&gt;I created a new Lakebase project to retrace all my steps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;0- I reused my service principal on the workspace&lt;/P&gt;&lt;P&gt;1- installed databricks authentication extension:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CREATE EXTENSION IF NOT EXISTS databricks_auth;&lt;/LI-CODE&gt;&lt;P&gt;2-Added the lakehouse service principal to the lakebase project&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT databricks_create_role('{UUID}', 'SERVICE_PRINCIPAL');&lt;/LI-CODE&gt;&lt;P&gt;3- Enabled Data API to get authenticator user created&lt;/P&gt;&lt;P&gt;4- Finally granted authenticator role to the service principal&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GRANT "{UUID}" TO authenticator;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;And this time it worked. I do not understand what the difference is to last time, maybe my authenticator user was somehow corrupted.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/210897"&gt;@balajij8&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/110502"&gt;@szymon_dybczak&lt;/a&gt;&amp;nbsp;for your answers and suggestions&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2026 19:42:38 GMT</pubDate>
    <dc:creator>_Lilith</dc:creator>
    <dc:date>2026-04-24T19:42:38Z</dc:date>
    <item>
      <title>Lakebase login via REST for a service principal</title>
      <link>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155441#M92</link>
      <description>&lt;DIV&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I’m trying to set up REST-based communication between my Lakebase and a REST-client.&lt;/P&gt;&lt;P&gt;I’m following the documentation &lt;STRONG&gt;“&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/auth/oauth-m2m#manually-generate-oauth-m2m-access-tokens" target="_blank" rel="noopener"&gt;Connecting to Lakebase via REST using a service principal&lt;/A&gt;”&lt;/STRONG&gt; to obtain a workspace-level token. After that, I use the &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/oltp/projects/data-api" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Lakebase Data API&lt;/STRONG&gt;&lt;/A&gt; to authenticate against Lakebase and create/configure my user.&lt;/P&gt;&lt;P&gt;However, I’m running into a &lt;STRONG&gt;403 error&lt;/STRONG&gt; with the message:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;EM&gt;Permission denied to set role {SP client ID}&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;My assumption is that this happens because I can’t grant the &lt;STRONG&gt;authenticator&lt;/STRONG&gt; role to a service principal.&lt;/P&gt;&lt;P&gt;Does this mean that using user-based OAuth or username/password authentication is the only way to access Lakebase via REST? Neither of these options seems very secure to me.&lt;BR /&gt;Or am I missing a supported approach for service principals here?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Apr 2026 10:40:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155441#M92</guid>
      <dc:creator>_Lilith</dc:creator>
      <dc:date>2026-04-24T10:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Lakebase login via REST for a service principal</title>
      <link>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155446#M93</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You need to assing a proper role for your Service Principal. Go to:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Roles &amp;amp; Databases&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Add role&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;OAuth&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tab, select the service principal to grant database access to.&lt;/LI&gt;&lt;LI&gt;After creating the role, you need to also grant permissons&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Both those steps are well described at below docs:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Adding role:&amp;nbsp;&lt;/STRONG&gt;&lt;A href="https://docs.databricks.com/aws/en/oltp/projects/data-api#add-postgres-roles" rel="noopener" target="_blank"&gt;Lakebase Data API | Databricks on AWS&lt;/A&gt;&lt;/P&gt;&lt;H4 id="grant-permissions-to-users"&gt;Grant permissions:&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/oltp/projects/data-api#grant-permissions-to-users" rel="noopener" target="_blank"&gt;Lakebase Data API | Databricks on AWS&lt;/A&gt;&lt;/H4&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If my answer was helpful, please consider marking it as accepted solution.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 12:00:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155446#M93</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2026-04-24T12:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lakebase login via REST for a service principal</title>
      <link>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155449#M94</link>
      <description>&lt;P&gt;Thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are the steps that I have also followed and had linked to in my question.&lt;/P&gt;&lt;P&gt;When granting permissions, the first line of the documentation fails when I use a service principal&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;-- Allow authenticator to assume the identity of the user
GRANT "{service principal user ID}" TO authenticator;&lt;/LI-CODE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT size="3"&gt;ERROR: permission denied to grant role "{service principal user ID}"&amp;nbsp;(SQLSTATE 42501)&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 12:25:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155449#M94</guid>
      <dc:creator>_Lilith</dc:creator>
      <dc:date>2026-04-24T12:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Lakebase login via REST for a service principal</title>
      <link>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155451#M95</link>
      <description>&lt;P&gt;&lt;SPAN&gt;You can change the code to use the client application ID (UUID) of the service principal as the identity name and run it.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GRANT "UUID" TO authenticator;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 13:06:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155451#M95</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-04-24T13:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Lakebase login via REST for a service principal</title>
      <link>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155455#M96</link>
      <description>&lt;P&gt;That is what I am using. Taking the example of the documentation what I do first is:&lt;/P&gt;&lt;P&gt;1- Create a service principal in the workspace&lt;/P&gt;&lt;P&gt;2- Add the service principal as a user in lakebase, using service principals Application ID&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT databricks_create_role('8c01cfb1-62c9-4a09-88a8-e195f4b01b08', 'SERVICE_PRINCIPAL');&lt;/LI-CODE&gt;&lt;P&gt;3- I get the mentioned error at the first step of giving permissions in the SQL editor:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;-- Allow authenticator to assume the identity of the user
GRANT "8c01cfb1-62c9-4a09-88a8-e195f4b01b08" TO authenticator;&lt;/LI-CODE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT size="3"&gt;ERROR: permission denied to grant role "8c01cfb1-62c9-4a09-88a8-e195f4b01b08"&amp;nbsp;(SQLSTATE 42501)&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 24 Apr 2026 14:12:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155455#M96</guid>
      <dc:creator>_Lilith</dc:creator>
      <dc:date>2026-04-24T14:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lakebase login via REST for a service principal</title>
      <link>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155459#M97</link>
      <description>&lt;P&gt;It's failing due to insufficient privileges. Can you check that you have '&lt;STRONG&gt;Can Manage&lt;/STRONG&gt;' access under Project Permissions in the Lake base project? If you have '&lt;STRONG&gt;Can Use&lt;/STRONG&gt;' access, you can ask for '&lt;STRONG&gt;Can Manage&lt;/STRONG&gt;' access or you can ask the admin to run the GRANT sequence to initialize the Service Principal&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 15:33:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155459#M97</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-04-24T15:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lakebase login via REST for a service principal</title>
      <link>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155467#M98</link>
      <description>&lt;P&gt;I created a new Lakebase project to retrace all my steps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;0- I reused my service principal on the workspace&lt;/P&gt;&lt;P&gt;1- installed databricks authentication extension:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CREATE EXTENSION IF NOT EXISTS databricks_auth;&lt;/LI-CODE&gt;&lt;P&gt;2-Added the lakehouse service principal to the lakebase project&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT databricks_create_role('{UUID}', 'SERVICE_PRINCIPAL');&lt;/LI-CODE&gt;&lt;P&gt;3- Enabled Data API to get authenticator user created&lt;/P&gt;&lt;P&gt;4- Finally granted authenticator role to the service principal&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GRANT "{UUID}" TO authenticator;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;And this time it worked. I do not understand what the difference is to last time, maybe my authenticator user was somehow corrupted.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/210897"&gt;@balajij8&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/110502"&gt;@szymon_dybczak&lt;/a&gt;&amp;nbsp;for your answers and suggestions&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 19:42:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/lakebase-discussions/lakebase-login-via-rest-for-a-service-principal/m-p/155467#M98</guid>
      <dc:creator>_Lilith</dc:creator>
      <dc:date>2026-04-24T19:42:38Z</dc:date>
    </item>
  </channel>
</rss>

