BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sathya66
Barite | Level 11

Hi All,
trying to generate a token by using below code but it is timing out. any idea?
what is base URL? is it where we use URL to connect to SAS Viya?
sas.demo.com IP address is different than below Ips (10.11.11.123 or 10.11.11.122)
ERROR: Error connecting to 10.11.11.123.(The connection has timed out)
ERROR: Error connecting to 10.11.11.122.(The connection has timed out)
ERROR:Unable to establish connection to sas.demo.com.
ERROR:Unable to connect to Web server

Happy to share more logs

 

%macro GenerateToken(user = , pw = , baseURL = );
/* ======================================= 1: Generate token ======================================= */
%let _tokenURL=%nrbquote(&baseURL./SASLogon/oauth/token?grant_type=password%nrstr(&)username=&user%nrstr(&)password=&pw);
options noquotelenmax;

%mend;
%GenerateToken(user=test_user, pw=Welcome, baseURL=https://sas.demo.com);
1 ACCEPTED SOLUTION

Accepted Solutions
sathya66
Barite | Level 11

Thanks for this,

I sorted this.

by doing 

  • the server details
  • consul token
  • user id and passwords.

Created a client/secret pair on the server that will be used to generate the authorisation token for the API calls

View solution in original post

2 REPLIES 2
joeFurbee
Community Manager

Hi @sathya66

Yes, baseURL would need to match the value of your SAS server URL. In the sample code baseURL=https://sas.demo.com is where you would substitute your server value (you'd also need to use YOUR user and pw as well).


Join us for SAS Community Trivia
SAS Bowl XLIII, The New SAS Developer Portal
Wednesday, August 14, 2024, at 10 a.m. ET | #SASBowl

sathya66
Barite | Level 11

Thanks for this,

I sorted this.

by doing 

  • the server details
  • consul token
  • user id and passwords.

Created a client/secret pair on the server that will be used to generate the authorisation token for the API calls

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

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