You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/07/21 20:46:35 UTC

[GitHub] [superset] j-goldsmith commented on issue #20800: Embedded dashboard auto reloads with ReferenceError: Buffer is not defined at getGuestTokenRefreshTiming

j-goldsmith commented on issue #20800:
URL: https://github.com/apache/superset/issues/20800#issuecomment-1191917514

   I'm running into a similar bug, followed by 403 errors when the embed iframe makes requests to the api.
   
   v 2.0.0
   Firefox
   
   `<script>
           async function fetchGuestTokenFromBackend() {
               let response = await fetch('/superset/embed/FetchGuestToken/<uuid>');
   
               if (response.status === 200) {
                   return await response.text();
               }
               return null;
           }
   
           supersetEmbeddedSdk.embedDashboard({
               id: "<uuid>", 
               supersetDomain: "https://viz.domain.com",
               mountPoint: document.getElementById("viz"), 
               fetchGuestToken: () => fetchGuestTokenFromBackend(),
               dashboardUiConfig: {}, 
           });
   
       </script>`
   
   Guest token seems to be generated fine, except that after the "Buffer is not Defined" error, the subsequent request from the iframe to https://viz.domain.com/api/v1/me/roles/ sends back inaccurate isActive, roles, and permissions.
   
   `
   [HTTP/2 200 OK 111ms]
   {"result":{
   "firstName":"first",
   "isActive":false,
   "isAnonymous":false,
   "lastName":"last",
   "permissions":{},"roles":{},
   "username":"user"}}
   `
   
   That user is active, has roles and was authorized for the dashboard being embedded. I tried adding a browserfied version of Buffer with no luck, but that may be my lack of frontend bundling experience. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org