BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
xda1
Calcite | Level 5

Hi, i am currently exploring several REST API use cases through the guidelines that were posted on GitHub. I am trying to go through the Authentication process for Postman but very lost at the very first step. It will be great if anyone can help me with my question.  Like where should i type in the first two lines of code?

 

Thank you!

https://github.com/sassoftware/rest-api-use-cases/tree/main/postman/authentication

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
joeFurbee
Community Manager

SAS does not currently allow access from external sources (e.g., REST clients) on the SAS Viya trial environments. Hence, you'll not be able register clients or generate access tokens.

 

The SAS Viya trials run the latest LTS version. The authentication instructions in the GH repo you initially provided are for older versions of SAS. The instructions in the blog post I provided are for the newer version. I'll work on updating the authentication scripts to provide both versions of code. You can find a Python version of the new code here.

 

To answer your question, you're server URL would be the URL you use to access the SAS Viya GUI interface, e.g., https://mysasviyatrial.sas.com.

 

 Again, I'll work on getting a Postman version of the newer code published soon.


Join us for SAS Community Trivia
SAS Bowl XL, SAS Innovate 2024 Recap
Wednesday, May 15, 2024, at 10 a.m. ET | #SASBowl

View solution in original post

3 REPLIES 3
joeFurbee
Community Manager

Hi @xda1,

The process outlined in the GitHub repo is one of many ways to get an access token. If you can answer a few questions (see below), I can assist in getting you the proper Postman collection. This post on SAS Users blog will help you understand the process a little better.

 

Questions

What version of SAS Viya are you running? 

Do you have a preference in grant types (password, auth code, client creds)? See the blog post for more info on this.

 

Thanks,

Joe


Join us for SAS Community Trivia
SAS Bowl XL, SAS Innovate 2024 Recap
Wednesday, May 15, 2024, at 10 a.m. ET | #SASBowl

xda1
Calcite | Level 5

Hi Joe,

Thank you for the comment. I have read the blog you wrote ( which is awesome btw, thank you so much for writing that) and was following the steps of auth code alongside the instructions.  When i was doing this step :

 https://sasserver.demo.sas.com/SASLogon/oauth/authorize?client_id=sas.cli&response_type=token

 

the page threw me errors , so instead of getting this:

 

https://sasserver.demo.sas.com/SASLogon/out_of_band#token_type=bearer&access_token=eyJhbGciOiJSUzI..........

 

i was getting something else like:

 error=unsupported_responsetype&error_description=Unsupported ............

 

Since i am just a student using SAS Viya 14-trails to explore things, i wonder if that might be the reason that I am getting this error.  Also, I am still quite unsure what my server URL is supposed to look like, as when I was watching many tutorial videos on the Internet, including the SAS REST API Webinar hosted by you, my server URL  seem to look quite different than others.

 

It will be great if you can help me with my question. Thank you again for the help!

 

 

 

joeFurbee
Community Manager

SAS does not currently allow access from external sources (e.g., REST clients) on the SAS Viya trial environments. Hence, you'll not be able register clients or generate access tokens.

 

The SAS Viya trials run the latest LTS version. The authentication instructions in the GH repo you initially provided are for older versions of SAS. The instructions in the blog post I provided are for the newer version. I'll work on updating the authentication scripts to provide both versions of code. You can find a Python version of the new code here.

 

To answer your question, you're server URL would be the URL you use to access the SAS Viya GUI interface, e.g., https://mysasviyatrial.sas.com.

 

 Again, I'll work on getting a Postman version of the newer code published soon.


Join us for SAS Community Trivia
SAS Bowl XL, SAS Innovate 2024 Recap
Wednesday, May 15, 2024, at 10 a.m. ET | #SASBowl