<?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 sas-airflow-provider OAuth in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-OAuth/m-p/960861#M29694</link>
    <description>&lt;P&gt;&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am experimenting with sas-airflow-provider (&lt;A href="https://github.com/sassoftware/sas-airflow-provider" target="_blank"&gt;https://github.com/sassoftware/sas-airflow-provider&lt;/A&gt;). I am trying to use the SASJobExecutionOperator to launch SAS Job Definition objects from Airflow. Note: I am using SAS Viya 3.5, not 4.0!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Everything worked in the development environment, where we have fewer restrictions, but I am missing something in production.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Everything is as straightforward as in the documentation:&lt;/P&gt;&lt;P&gt;1. Task to execute SAS code using a SAS Job:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sas_job_1_task = SASJobExecutionOperator(
task_id='airflow-sas-job-example-1',
job_name='/Public/Airflow/airflow-sas-job',
connection_name='sas_default',
job_exec_log=True,
add_airflow_vars=True,
parameters={
**job_parameters,
"code_name": "airflow-sas-code.sas"
},
dag=dag,
)&lt;/LI-CODE&gt;&lt;P&gt;2. sas_default connection:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas_default_connection.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105152iA390E1504A5B0E09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sas_default_connection.jpg" alt="sas_default_connection.jpg" /&gt;&lt;/span&gt;&lt;BR /&gt;3. Airflow log file:&lt;/P&gt;&lt;LI-CODE lang="shell"&gt;{base.py:84} INFO - Retrieving connection 'sas_default'
{sas.py:55} INFO - Using custom TLS CA certificate bundle file
{sas.py:63} INFO - Creating session for connection named sas_default to host https://mycompany.com/
{sas.py:83} INFO - Get oauth token (see README if this crashes)
{taskinstance.py:3311} ERROR - Task failed with exception
&amp;lt;...&amp;gt;
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))&lt;/LI-CODE&gt;&lt;P&gt;4. No sessions were created on the SAS Viya side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My guess is that something is missing related to OAuth. For the connection, I provide only the SAS Viya user and password, as well as a certificate, but no OAuth token.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Among the parameters sent to SAS Viya, I believe there are default values related to authorization, as shown below:&lt;/P&gt;&lt;P&gt;Basic {base64(client_id:client_secret)}&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;client_id defaults to "sas.cli"&lt;/LI&gt;&lt;LI&gt;client_secret defaults to an empty string&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;But this shouldn't be a problem, right?&amp;nbsp;I'm not sure how to proceed or resolve this issue, not&amp;nbsp;much expertise in this area.&lt;BR /&gt;&lt;BR /&gt;Mindaugas&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Mar 2025 17:09:00 GMT</pubDate>
    <dc:creator>misul</dc:creator>
    <dc:date>2025-03-04T17:09:00Z</dc:date>
    <item>
      <title>sas-airflow-provider OAuth</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-OAuth/m-p/960861#M29694</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am experimenting with sas-airflow-provider (&lt;A href="https://github.com/sassoftware/sas-airflow-provider" target="_blank"&gt;https://github.com/sassoftware/sas-airflow-provider&lt;/A&gt;). I am trying to use the SASJobExecutionOperator to launch SAS Job Definition objects from Airflow. Note: I am using SAS Viya 3.5, not 4.0!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Everything worked in the development environment, where we have fewer restrictions, but I am missing something in production.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Everything is as straightforward as in the documentation:&lt;/P&gt;&lt;P&gt;1. Task to execute SAS code using a SAS Job:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sas_job_1_task = SASJobExecutionOperator(
task_id='airflow-sas-job-example-1',
job_name='/Public/Airflow/airflow-sas-job',
connection_name='sas_default',
job_exec_log=True,
add_airflow_vars=True,
parameters={
**job_parameters,
"code_name": "airflow-sas-code.sas"
},
dag=dag,
)&lt;/LI-CODE&gt;&lt;P&gt;2. sas_default connection:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas_default_connection.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105152iA390E1504A5B0E09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sas_default_connection.jpg" alt="sas_default_connection.jpg" /&gt;&lt;/span&gt;&lt;BR /&gt;3. Airflow log file:&lt;/P&gt;&lt;LI-CODE lang="shell"&gt;{base.py:84} INFO - Retrieving connection 'sas_default'
{sas.py:55} INFO - Using custom TLS CA certificate bundle file
{sas.py:63} INFO - Creating session for connection named sas_default to host https://mycompany.com/
{sas.py:83} INFO - Get oauth token (see README if this crashes)
{taskinstance.py:3311} ERROR - Task failed with exception
&amp;lt;...&amp;gt;
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))&lt;/LI-CODE&gt;&lt;P&gt;4. No sessions were created on the SAS Viya side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My guess is that something is missing related to OAuth. For the connection, I provide only the SAS Viya user and password, as well as a certificate, but no OAuth token.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Among the parameters sent to SAS Viya, I believe there are default values related to authorization, as shown below:&lt;/P&gt;&lt;P&gt;Basic {base64(client_id:client_secret)}&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;client_id defaults to "sas.cli"&lt;/LI&gt;&lt;LI&gt;client_secret defaults to an empty string&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;But this shouldn't be a problem, right?&amp;nbsp;I'm not sure how to proceed or resolve this issue, not&amp;nbsp;much expertise in this area.&lt;BR /&gt;&lt;BR /&gt;Mindaugas&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 17:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-OAuth/m-p/960861#M29694</guid>
      <dc:creator>misul</dc:creator>
      <dc:date>2025-03-04T17:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: sas-airflow-provider OAuth</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-OAuth/m-p/960877#M29696</link>
      <description>SASLogon returns an oauth token when you log in. The client ID and secret (sas.cli:) is valid, this is the client used by the sas-admin CLI.&lt;BR /&gt;The failure here seems to be saying that when airflow is trying to connect to the environment &lt;A href="https://mycompany.com/SASLogon" target="_blank"&gt;https://mycompany.com/SASLogon&lt;/A&gt; to get a token, the network connection is being reset on the other side. I would suspect this has something to do with firewall limitations in place on your production environment preventing a connection from the host where the task is running.</description>
      <pubDate>Tue, 04 Mar 2025 19:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-OAuth/m-p/960877#M29696</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2025-03-04T19:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: sas-airflow-provider OAuth</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-OAuth/m-p/961186#M29710</link>
      <description>&lt;P&gt;You were right; this was a WAF-related issue. We had an IP filter for access, and after adding the IP to the whitelist, everything works fine!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 07:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-OAuth/m-p/961186#M29710</guid>
      <dc:creator>misul</dc:creator>
      <dc:date>2025-03-07T07:37:13Z</dc:date>
    </item>
  </channel>
</rss>

