<?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_bearer does not seem to support encoded tokens in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976500#M84066</link>
    <description>&lt;P&gt;What does the Databricks job do? What about using SAS/ACCESS Interface to Databricks to execute a stored procedure running the processes you want instead?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Oct 2025 02:26:36 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2025-10-07T02:26:36Z</dc:date>
    <item>
      <title>oauth_bearer does not seem to support encoded tokens</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976457#M84065</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to set up a program calling rest API in order to trigger a databricks job. The issue I am facing is that I cannot encrypt the token and it only works if the oauth_bearer value is provided in plaintext. This gives me error 401:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;filename pwfile 'testpw.txt';

proc pwencode in="foo" out=pwfile method=sas005;
run;

data _null_;
	infile pwfile truncover;
	input line :$200.;
	call symputx('dbxtoken',line);
run;

filename jpl 'testin.json';

proc json out=jpl;
	write values "job_id" "1234";
run;

filename jrp 'testout.json';

proc http url="https://dbc-abcd-1234.cloud.databricks.com/api/2.2/jobs/run-now"
	method=post
	in=jpl
	out=jrp
	oauth_bearer="&amp;amp;dbxtoken";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Whereas this works as intended:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;filename jpl 'testin.json';

proc json out=jpl;
	write values "job_id" "1234";
run;

filename jrp 'testout.json';

proc http url="https://dbc-abcd-1234.cloud.databricks.com/api/2.2/jobs/run-now"
	method=post
	in=jpl
	out=jrp
	oauth_bearer="&amp;amp;foo";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is this expected? And if so, what would be the alternative for not having to store the service principal secret in plaintext? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 11:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976457#M84065</guid>
      <dc:creator>js5</dc:creator>
      <dc:date>2025-10-06T11:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: oauth_bearer does not seem to support encoded tokens</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976500#M84066</link>
      <description>&lt;P&gt;What does the Databricks job do? What about using SAS/ACCESS Interface to Databricks to execute a stored procedure running the processes you want instead?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 02:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976500#M84066</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-10-07T02:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: oauth_bearer does not seem to support encoded tokens</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976611#M84067</link>
      <description>&lt;P&gt;The job copies data from SQL server bound as catalog to another schema. We are testing direct upload via ODBC in parallel, but unfortunately the performance is insufficient.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 06:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976611#M84067</guid>
      <dc:creator>js5</dc:creator>
      <dc:date>2025-10-08T06:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: oauth_bearer does not seem to support encoded tokens</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976635#M84068</link>
      <description>&lt;P&gt;The 3rd party app with which SAS communicates doesn't "know" how SAS password encoding and decoding works. SAS must therefore send the password cleartext. This is also true for SAS Access where you're passing something like pw="{SAS005}6DDE667...." SAS will during runtime decode the password and send it cleartext to the database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears such decoding is not implemented for proc http with&amp;nbsp;oauth_bearer parameter and therefore you can't use a SAS encoded password but must send it cleartext.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on some Googling Databricks supports OAuth Token Federation - but SAS only fully supports it in the Viya version. ...and it would also require some setup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For&amp;nbsp;OAuth Bearer Token you could store your token in a secure location and access it during runtime (=not directly storing it in the script). Another option would be to wrap your code into a SAS macro that you compile secure into some permanent SAS catalogue - with the token provided as macro parameter when you compile the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 10:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976635#M84068</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2025-10-08T10:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: oauth_bearer does not seem to support encoded tokens</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976665#M84069</link>
      <description>&lt;P&gt;I recommend you engage with Tech Support regarding the slow upload.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 19:29:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976665#M84069</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-10-08T19:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: oauth_bearer does not seem to support encoded tokens</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976677#M84070</link>
      <description>&lt;P&gt;I did engage both SAS and Databricks tech support, but I am exploring alternatives in parallel.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 05:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/oauth-bearer-does-not-seem-to-support-encoded-tokens/m-p/976677#M84070</guid>
      <dc:creator>js5</dc:creator>
      <dc:date>2025-10-09T05:20:03Z</dc:date>
    </item>
  </channel>
</rss>

