BookmarkSubscribeRSS Feed
jujupapaye_sas
Calcite | Level 5

Hello,

 

I want to create a portal to see report from SAS Viya,  the SAS Visual Analytics SDK ( https://developer.sas.com/sdk/va/docs/getting-started/  ) is made for this, but the way the authentication is done (you have to press a button saying "Initiate session" and then you have the sas viya authentication page that opens) is not very user friendly.

 

We want the opening page of our app to be directly the authentification page for Viya. We created a simple authentification html page like this :

 

page_html.PNG

that we want to allow persistent authentication to Sas Viya for any end users. Once they would be identified, the end users will see the reports.

 

Reading this article "SAS Authentication for ReactJS based applications" ( https://communities.sas.com/t5/SAS-Communities-Library/SAS-Authentication-for-ReactJS-based-applicat... ), I understood that i need to send a request POST to SASLogon ( https://developer.sas.com/apis/rest/CoreServices/?javascript#grant-access-using-client-credentials  ) in javascript it gave:

 

grantAcessUsingPassword.PNG

 

I tried that with my user/password and I have that error : {"error":"unauthorized","error_description":"Bad credentials"}. The configuration of the Cross-Origin Resource Sharing is done. I think I miss something with the 'Authorization' parameter (I tried to put 'string', and not passing it)..

 

Can someone help me .. ? I tried to search in the code of the Visual Analytics SDK where is the part of the code that do the authentification, but the code is unreadable, I tried the request for grant acess using client credentials and password that are documented here : https://developer.sas.com/apis/rest/CoreServices/?javascript#grant-access-using-client-credentials . But I always have an error

 

 

Thank you

 

 

1 REPLY 1
XavierBizoux
SAS Super FREQ

Hi

The authentication mechanism for the SAS Visual Analytics SDK is different from the one used for the REST APIs. The blog series you mention is taking care of the authentication for the REST APIs. At this time for the VA SDK, you need to be authenticated through the SAS Logon Manager. Knowing this, you have different options for authenticating your users. 

  1. Get the prompt as soon as the user opens the page. 
  2. Be authenticated before accessing your page.

For the first option, you should include the logic in your web application to route the users to the SASLogon and retrieve the authentication token like described in the blog series.

The second option will be to configure a SSO for SAS Viya. You can then authenticate your users against that a third-party provider and the SSO will allow authentication of your users for the VA SDK. 

There are discussions internally to provide in the SDK a kind of Login tag (like for va-report-object and other SDK related tags) but this is a work in progress and I don't have a date for the availability. 

If you are building a portal like application, you might be interested by this: https://communities.sas.com/t5/SAS-Communities-Library/An-approach-to-SAS-Portal-in-Viya/ta-p/791388

It currently has two articles but a third one with the SAS Content SDK is coming next week and others will come nearly every month with topics like chatbot, authentication, Job execution integration, report integration, ...

Please let me know if you have questions.

Xavier

Xavier BIZOUX
Advisory Technical Architect ● Global Enablement and Learning
Technology Transfer and Governance, R&D

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
  • 1 reply
  • 860 views
  • 1 like
  • 2 in conversation