<?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 CLI error for OAuth authentication in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/CLI-error-for-OAuth-authentication/m-p/618716#M18681</link>
    <description>&lt;P&gt;I am trying to create a library using code that links to our Dynamics365 Sales database.&amp;nbsp; I am using a piece of software called CData to allow this link.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently it only works if I was to create the library manually by going to Tools &amp;gt; New Library, for name I used: PRM, for Engine, I selected: ODBC, for Data Source I chose: CData D365Sales Sys.&amp;nbsp; User ID and Password is the same as my windows login. And Options I've left blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above manual method will force a browser to open with the message OAuth Authorization Successful twice, once for creating the library and another when clicking into the library in the SAS Explorer window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now my issue is that I am trying to mimic this in code form.&amp;nbsp; Below is the code I've tried using (I am using SAS 9.4):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dsn=CData D365Sales Sys;
libname prm odbc noprompt="dsn=&amp;amp;dsn;Trusted_Connection=yes" schema=DBO access=readonly; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I get the following error message.&amp;nbsp; Hoping someone&amp;nbsp;can elaborate what needs to be done as I am unclear from just the error message alone. i.e. where do I find the DSN manager and&amp;nbsp;how to authenticate it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300" size="2"&gt;ERROR: CLI error trying to establish connection: The driver requires a user prompt for OAuth&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300" size="2"&gt;authentication which is not allowed by this application. Please use the DSN manager to&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300" size="2"&gt;authenticate before using the driver in this application.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300" size="2"&gt;ERROR: Error in the LIBNAME statement.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2020 22:41:58 GMT</pubDate>
    <dc:creator>Hans_Luc</dc:creator>
    <dc:date>2020-01-20T22:41:58Z</dc:date>
    <item>
      <title>CLI error for OAuth authentication</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CLI-error-for-OAuth-authentication/m-p/618716#M18681</link>
      <description>&lt;P&gt;I am trying to create a library using code that links to our Dynamics365 Sales database.&amp;nbsp; I am using a piece of software called CData to allow this link.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently it only works if I was to create the library manually by going to Tools &amp;gt; New Library, for name I used: PRM, for Engine, I selected: ODBC, for Data Source I chose: CData D365Sales Sys.&amp;nbsp; User ID and Password is the same as my windows login. And Options I've left blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above manual method will force a browser to open with the message OAuth Authorization Successful twice, once for creating the library and another when clicking into the library in the SAS Explorer window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now my issue is that I am trying to mimic this in code form.&amp;nbsp; Below is the code I've tried using (I am using SAS 9.4):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dsn=CData D365Sales Sys;
libname prm odbc noprompt="dsn=&amp;amp;dsn;Trusted_Connection=yes" schema=DBO access=readonly; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I get the following error message.&amp;nbsp; Hoping someone&amp;nbsp;can elaborate what needs to be done as I am unclear from just the error message alone. i.e. where do I find the DSN manager and&amp;nbsp;how to authenticate it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300" size="2"&gt;ERROR: CLI error trying to establish connection: The driver requires a user prompt for OAuth&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300" size="2"&gt;authentication which is not allowed by this application. Please use the DSN manager to&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300" size="2"&gt;authenticate before using the driver in this application.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300" size="2"&gt;ERROR: Error in the LIBNAME statement.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 22:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CLI-error-for-OAuth-authentication/m-p/618716#M18681</guid>
      <dc:creator>Hans_Luc</dc:creator>
      <dc:date>2020-01-20T22:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: CLI error for OAuth authentication</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CLI-error-for-OAuth-authentication/m-p/618765#M18695</link>
      <description>&lt;P&gt;What OS does SAS run on? Your connection string is using Windows Authentication so will only work on Windows. Also your DSN needs to point to a single definition, not three. On Windows the DSN would be defined in the ODBC Administrator on the computer where SAS runs.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 05:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CLI-error-for-OAuth-authentication/m-p/618765#M18695</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-01-21T05:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: CLI error for OAuth authentication</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CLI-error-for-OAuth-authentication/m-p/618768#M18696</link>
      <description>I'm using Windows 10. In the ODBC Administrator under the System DSN tab, the Name is "CData D365Sales Sys", Platform is "64-bit", Driver is "CData ODBC Driver for Dynamics 365 Sales"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jan 2020 05:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CLI-error-for-OAuth-authentication/m-p/618768#M18696</guid>
      <dc:creator>Hans_Luc</dc:creator>
      <dc:date>2020-01-21T05:58:08Z</dc:date>
    </item>
  </channel>
</rss>

