Closed fatchat closed 1 year ago
Fetch from /currentuser :
the superset url the superset login type (username + password / google oauth / [other oauth in future])
This will be from org API endpoint of current user in future - 0.2/0.3 ?
If the client is not paying for Superset, these responses will be empty. But in case they are not, then:
Display Superset in a new "Analytics" page
If superset is not enabled for org, page should display with message " Superset not Enabled - Call to action button to contact Sales to enable or something like this
we were not able to implement google oauth login inside the iframe
so for oauth logins
for u+p logins
superset is embedded.
1) for oauth logins users will have to type their u + p and login in to the embed superset.
2) for google oauth, we will have a google siginin
button on the top/besides the iframe. Users will have to login via the button since oauth doesn't work in iframes.
We tried to close the popup window of oauth by using messge and event listeners, however it is not possible to fetch the location of the child window once the user is logged in. Since the child's origin changes from localhost:8088 (superset domain)
to accounts.google.com..
while signing in, the parent is no longer able to send the message due to a CORS error i.e. the child's popup target origin changed.
Parent (webapp)
var locationStatusInterval = setInterval(() => {
authWindow?.postMessage(
{ ask: 'locationStatus' },
`${globalContext?.CurrentOrg?.state.viz_url}/#child`
);
}, 2000);
window?.addEventListener('message', (event) => {
console.log('receieved something', event.data);
const message = event.data;
if (
message?.locationStatus &&
message.locationStatus === '/superset/welcome/'
) {
console.log('asking the window to be closed', message.locationStatus);
authWindow?.close();
authWindow = null;
clearInterval(locationStatusInterval);
}
});
Child popup (for google oauth) Code for this is in one of the html files of superset.
console.log("base layout loaded");
window.addEventListener("message", function (event) {
const message = event.data;
console.log("someone asked for soemthign");
if (message?.ask === "locationStatus") {
console.log("someone asked for locationStatus");
event.source.postMessage({ locationStatus: window.location.pathname }, event.origin);
}
});
Problems:
@nairabhishek73
We could choose to address point 1 now or later(as a separate issue).
Let’s put in a loading indicator
During these three seconds there’s nothing else in the panel right, other than the word “Analysis”?
On Fri, 18 Aug 2023 at 4:32 AM, nairabhishek73 @.***> wrote:
- Its taking a noticeable 3 seconds for the "Google Sign in" (also note there should be a space between Sign and in) option to pop up everytime I go to the Analysis tab. Enough time for me to panic and click elsewhere. This delay applies even to embedded superset after i've logged in.
- Its loading immediately on our UI once i sign in on the pop up window. That's great.
- I am not required to login to superset again if I logout from DDP UI and then log back in. This is great.
We could choose to address point 1 now or later(as a separate issue).
— Reply to this email directly, view it on GitHub https://github.com/DevDataPlatform/webapp/issues/240#issuecomment-1683087249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQPOICNJJUHUEDRF3A7JQTXV2PIFANCNFSM6AAAAAA23BEHU4 . You are receiving this because you modified the open/close state.Message ID: @.***>
ok done @nairabhishek73
Works. Loading symbol was a great idea.
Fetch from
/currentuser
:If the client is not paying for Superset, these responses will be empty. But in case they are not, then:
Display Superset in a new "Analytics" page
And for unified login:
The iframe will contain a JavaScript listener which will
Error reporting