SolidOS / solidos

The operating system for Solid
https://solidos.solidcommunity.net/
MIT License
127 stars 19 forks source link

Jumping to redirect uri of original page #73

Closed jeff-zucker closed 3 years ago

jeff-zucker commented 3 years ago

[Edit] See summary of this issue below.

If we login on pageA on domainA, get redirected back to pageA, click on an HTML link that points to pageB on the same domain, if pageB calls UI.authn.checkUser(), pageB will load and then redirect to wherever pageA redirected to.

Test it for yourself. The link is a plain HTML anchor to a page that contains nothing but a call to UI.authn.checkUser() and some text.

https://jeff-zucker.solidcommunity.net:8443/test/jump-uri.html

jaxoncreed commented 3 years ago

Did the solution of saving the page uri in local storage then setting retrieving it after the refresh token redirect work?

jeff-zucker commented 3 years ago

I can only do that if I catch the page redirect, write the cookie, logout, and then create a link from the cookie. But in this example it's not a matter of saving anything. The link is hard coded. It is impossible to move off of pageA to pageB without redirecting back to pageA if both pages have currentUser() no matter where the link comes from.

jeff-zucker commented 3 years ago

At the moment, this issue only impacts browse.html in two not so-common cases - a) user mounts browse.html on their own pod and then tries to use it to examine their own pod - it works everywhere else but not on the pod it is mounted on which jumps out of browse.html, b) user is logged in and has a second window/tab at another browse instance - the second will redirect to the first.

jaxoncreed commented 3 years ago

It is impossible to move off of pageA to pageB without redirecting back to pageA

At least based on my understanding, if you save the URL on pageB right before currentUser() is called, you'll be able to restore it after it gets redirected to pageA.

scenaristeur commented 3 years ago

Could be same as https://github.com/inrupt/solid-client-authn-js/issues/1473 ?

jeff-zucker commented 3 years ago

@scenaristeur, it certainly looks like the same behavior.

@jaxoncreed - No, storing cookies does not solve this particular behavior. Do you agree with @scenaristeur that this is an inrupt/solid-client-authn-js bug? If so, I'd be inclined to close this here until that is fixed there.

jeff-zucker commented 3 years ago

The issue of two webapps in the same browser is covered here : https://github.com/inrupt/solid-client-authn-js/issues/1647. It is definitely an inrupt-client-authn issue, not a SolidOS issue. Apparently it is not currently expected to work. :-( That explains why I couldn't get it to work :-).

jeff-zucker commented 3 years ago

Summary of problems/solutions for this issue: