This post consolidates real-world cases and frequently encountered issues when embedding SAS Visual Analytics dashboards and reports using the SAS Visual Analytics SDK. It highlights symptoms, causes, and resolutions for a smoother integration.
The Software Development Kit (SDK) for SAS Visual Analytics is primarily designed for use with SAS Viya, not SAS 9.x. The SAS Visual Analytics SDK allows you to embed SAS Visual Analytics reports and objects into custom web applications and mobile apps. While SAS 9.4 can utilize SAS Visual Analytics 7.x, it doesn't have the same SAS Visual Analytics SDK capabilities as SAS Viya.
Cross-Origin Resource Sharing (CORS) is the most common hurdle. It occurs when your web application and your SAS Viya server are on different domains.
Symptoms:
Root Cause:
The domain of your web application (the "origin") has not been added to the SAS Viya configuration's list of allowed origins. The SAS server is rejecting the cross-domain request from your application.
Resolution:
Even with correct CORS settings, your own web server's security policy can block the SAS Visual Analytics SDK from functioning.
Symptoms:
The browser's developer console shows CSP-related error messages, for example:
Root Cause:
Your web server has an overly restrictive Content Security Policy (CSP) that prevents the browser from making connections to the SAS Viya server or loading scripts from the SAS CDN.
Resolution:
Update your web server's Content-Security-Policy HTTP header to permit connections and resources from the necessary SAS domains.
This issue occurs when SAS Viya is correctly configured for CORS, but the authentication step still fails.
Symptoms:
Root Cause:
The CORS headers are not being applied by your organization's external Single Sign-On (SSO) provider. When the SAS Visual Analytics SDK attempts to authenticate, the SSO provider's endpoint blocks the request because it doesn't trust the origin (https://my-webapp.com).
Resolution:
The CORS policy must be configured on your SSO infrastructure to allow requests from your web application's domain. This is a configuration on the SSO provider's side (e.g., Azure AD, Okta) and is outside the scope of SAS configuration.
Action: Contact your organization’s SSO administrator to update the SSO provider's CORS policy.
<html>
<head>
<script async src="https://cdn.developer.sas.com/packages/va-report-components/latest/dist/umd/va-report-components.js"></script>
<style>
html {
background-color: #f0f0f0;
}
sas-report {
width: 75%;
height: 75%;
--sas-report-padding: 10px;
display: block;
}
</style>
</head>
<body>
<sas-report hideNavigation="auto"
authenticationType="credentials"
url="https://your-sas-server"
reportUri="/reports/reports/your-report-id">
</sas-report>
</body>
</html>
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.