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?
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.
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 XLIII, The New SAS Developer Portal
Wednesday, August 14, 2024, at 10 a.m. ET | #SASBowl
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.