finos / legend-studio

Legend Studio
https://legend.finos.org
Apache License 2.0
89 stars 113 forks source link

Bug: Authentication token expired and not re-fetched after opening the editor for a long time #334

Open akphi opened 3 years ago

akphi commented 3 years ago

🐛 Bug Report

Reported by @beekemarie. After opening Studio for a long time and leave it there, I can't connect to SDLC anymore.

Step to Reproduce

Keep a tab open on legend.finos.org/studio for a while then go back in and make an execution, or do some SDLC tasks, I'm informed that I'm no-longer authenticated.

Expected behavior

Studio should automatically go fetch another token when the existing one expired

akphi commented 3 years ago

I'm aware but not an expert on our OAuth flow and might need help from @epsstan and @kevin-m-knight-gs to come up with a sensible solution for this.

akphi commented 3 years ago

After discussing with @kevin-m-knight-gs we would expect re-authentication/authorization to happen automatically for all network call to SDLC/engine due to the OIDC OAuth mechanism (for sure, please feel free to correct me here since I myself has not fully comprehended the flow there). So I don't really know how this could be happening. We should see if we can reproduce this at all or gather more evidence from the community.

akphi commented 2 years ago

I think to solve this issue, we can do what we mention in https://github.com/finos/legend-studio/issues/267 where we come up with a more generic mechanism to handle network error, especially when we know it comes from SDLC server, we could have a generic strategy to notify user or potentially an extension mechanism for reauthenticator for Gitlab OAuth in this case.