Developers

A forum for collaboration, Q&A, and knowledge sharing on SAS and open source integration
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
WaelAburezeq
Obsidian | Level 7

Hi folks,

 

Please forgive me if this post was written before somewhere, I searched the forum with no luck.

 

I am facing an issue while trying to obtain an access token as per this URL direction: https://developer.sas.com/reference/auth/

SESSION ON: [sas@aeadsaswf01-afs ~] 

 

export client_id="sss"
export client_secret="S@S_Deploy"
export server_name="aeadsaswf01-afs.adfca.ae"
export username="sasboot"
export userpass="Password1"

 

I successfully registered the client and got the followings:

 

{"scope":["openid"],"client_id":"sss","resource_ids":["none"],"authorized_grant_types":["password","refresh_token"],
          "access_token_validity":43199,"authorities":["uaa.none"],"lastModified":1591552596247}

However, when I run the next command:

 

   curl -X POST "https://$server_name/SASLogon/oauth/token" \
      -H "Content-Type: application/x-www-form-urlencoded" \
      -d "grant_type=password&username=$username&password=$userpass" \
      -u "sss:S@S_Deploy"

 

I get an error although I am 100% sure that user & 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. 

 

{"error":"unauthorized","error_description":"Bad credentials"}

 

Hint: I also tried to add the username and password by hand instead of a variable, this sasboot user is not on LDAP.

However, I tried another LDAP user too and I got the same error!; both users are admins.

 

Any help please?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WaelAburezeq
Obsidian | Level 7

Hi Joe & Allan,

 

Thank you for your feedback. I figured out a way to solve the errors after I read them from the Post Man consoles:

1- I defined the variables as global ones, it seems that Pm.environment doesn't see them so I added them under the environment.

2- I had an error " Self Signed Certificate in Certificate Chain" , the fix is:

   * Go to Postman Settings > General > turn OFF SSL certificate verification

 

After I corrected both points then I was able to successfully run the script.

 

Thank you guys for your great coordination & support. 

 

 

 

View solution in original post

2 REPLIES 2
joeFurbee
Community Manager

Hi @WaelAburezeq,

I don't see anything sticking out from your code that would cause this error. Your next step may be to contact technical support: https://support.sas.com/en/technical-support.html#contact-technical-support.


Join us for SAS Community Trivia
SAS Bowl L, PROC HTTP
Wednesday, February 19, 2024, at 10:00 a.m. ET | #SASBowl

WaelAburezeq
Obsidian | Level 7

Hi Joe & Allan,

 

Thank you for your feedback. I figured out a way to solve the errors after I read them from the Post Man consoles:

1- I defined the variables as global ones, it seems that Pm.environment doesn't see them so I added them under the environment.

2- I had an error " Self Signed Certificate in Certificate Chain" , the fix is:

   * Go to Postman Settings > General > turn OFF SSL certificate verification

 

After I corrected both points then I was able to successfully run the script.

 

Thank you guys for your great coordination & support. 

 

 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1945 views
  • 0 likes
  • 2 in conversation