<?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 Obtaining Access Tokens: Bad Credentials although they are working on WEB Application in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Obtaining-Access-Tokens-Bad-Credentials-although-they-are/m-p/654054#M815</link>
    <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please forgive me if this post was written before somewhere, I searched the forum with no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing an issue while trying to obtain an access token as per this URL direction:&amp;nbsp;&lt;A href="https://developer.sas.com/reference/auth/" target="_blank" rel="noopener"&gt;https://developer.sas.com/reference/auth/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;SESSION ON:&amp;nbsp;[sas@aeadsaswf01-afs ~]&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;export client_id="sss"&lt;BR /&gt;export client_secret="S@S_Deploy"&lt;BR /&gt;export server_name="aeadsaswf01-afs.adfca.ae"&lt;BR /&gt;export username="sasboot"&lt;BR /&gt;export userpass="Password1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I successfully registered the client and got the followings:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{"scope":["openid"],"client_id":"sss","resource_ids":["none"],"authorized_grant_types":["password","refresh_token"],
          "access_token_validity":43199,"authorities":["uaa.none"],"lastModified":1591552596247}&lt;/PRE&gt;&lt;P&gt;However, when I run the next command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;   curl -X POST "https://$server_name/SASLogon/oauth/token" \
      -H "Content-Type: application/x-www-form-urlencoded" \
      -d "grant_type=password&amp;amp;username=$username&amp;amp;password=$userpass" \
      -u "sss:S@S_Deploy"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get an error although I am 100% sure that user &amp;amp; password credentials are correct, I am even able to login to WEB server or any server using them; I am an admin over the environment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{"error":"unauthorized","error_description":"Bad credentials"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hint: I also tried to add the username and password by hand instead of a variable, this sasboot user is not on LDAP.&lt;/P&gt;&lt;P&gt;However, I tried another LDAP user too and I got the same error!; both users are admins.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 07 Jun 2020 18:36:19 GMT</pubDate>
    <dc:creator>WaelAburezeq</dc:creator>
    <dc:date>2020-06-07T18:36:19Z</dc:date>
    <item>
      <title>Obtaining Access Tokens: Bad Credentials although they are working on WEB Application</title>
      <link>https://communities.sas.com/t5/Developers/Obtaining-Access-Tokens-Bad-Credentials-although-they-are/m-p/654054#M815</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please forgive me if this post was written before somewhere, I searched the forum with no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing an issue while trying to obtain an access token as per this URL direction:&amp;nbsp;&lt;A href="https://developer.sas.com/reference/auth/" target="_blank" rel="noopener"&gt;https://developer.sas.com/reference/auth/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;SESSION ON:&amp;nbsp;[sas@aeadsaswf01-afs ~]&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;export client_id="sss"&lt;BR /&gt;export client_secret="S@S_Deploy"&lt;BR /&gt;export server_name="aeadsaswf01-afs.adfca.ae"&lt;BR /&gt;export username="sasboot"&lt;BR /&gt;export userpass="Password1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I successfully registered the client and got the followings:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{"scope":["openid"],"client_id":"sss","resource_ids":["none"],"authorized_grant_types":["password","refresh_token"],
          "access_token_validity":43199,"authorities":["uaa.none"],"lastModified":1591552596247}&lt;/PRE&gt;&lt;P&gt;However, when I run the next command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;   curl -X POST "https://$server_name/SASLogon/oauth/token" \
      -H "Content-Type: application/x-www-form-urlencoded" \
      -d "grant_type=password&amp;amp;username=$username&amp;amp;password=$userpass" \
      -u "sss:S@S_Deploy"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get an error although I am 100% sure that user &amp;amp; password credentials are correct, I am even able to login to WEB server or any server using them; I am an admin over the environment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{"error":"unauthorized","error_description":"Bad credentials"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hint: I also tried to add the username and password by hand instead of a variable, this sasboot user is not on LDAP.&lt;/P&gt;&lt;P&gt;However, I tried another LDAP user too and I got the same error!; both users are admins.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 18:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Obtaining-Access-Tokens-Bad-Credentials-although-they-are/m-p/654054#M815</guid>
      <dc:creator>WaelAburezeq</dc:creator>
      <dc:date>2020-06-07T18:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining Access Tokens: Bad Credentials although they are working on WEB Application</title>
      <link>https://communities.sas.com/t5/Developers/Obtaining-Access-Tokens-Bad-Credentials-although-they-are/m-p/656358#M823</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/161470"&gt;@WaelAburezeq&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I don't see anything sticking out from your code that would cause this error. Your next step may be to contact technical support:&amp;nbsp;&lt;A href="https://support.sas.com/en/technical-support.html#contact-technical-support" target="_blank"&gt;https://support.sas.com/en/technical-support.html#contact-technical-support&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 11:19:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Obtaining-Access-Tokens-Bad-Credentials-although-they-are/m-p/656358#M823</guid>
      <dc:creator>joeFurbee</dc:creator>
      <dc:date>2020-06-10T11:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining Access Tokens: Bad Credentials although they are working on WEB Application</title>
      <link>https://communities.sas.com/t5/Developers/Obtaining-Access-Tokens-Bad-Credentials-although-they-are/m-p/656386#M824</link>
      <description>&lt;P&gt;Hi Joe &amp;amp; Allan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your feedback. I figured out a way to solve the errors after I read them from the Post Man consoles:&lt;/P&gt;&lt;P&gt;1- I defined the variables as global ones, it seems that Pm.environment doesn't see them so I added them under the environment.&lt;/P&gt;&lt;P&gt;2- I had an error " Self Signed Certificate in Certificate Chain" , the fix is:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;*&amp;nbsp;&lt;SPAN&gt;Go to Postman Settings &amp;gt; General &amp;gt; turn&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;OFF&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;SSL certificate verification&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I corrected both points then I was able to successfully run the script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you guys for your great coordination &amp;amp; support.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 12:29:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Obtaining-Access-Tokens-Bad-Credentials-although-they-are/m-p/656386#M824</guid>
      <dc:creator>WaelAburezeq</dc:creator>
      <dc:date>2020-06-10T12:29:26Z</dc:date>
    </item>
  </channel>
</rss>

