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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to