-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solid-client-authn-browser should use storage abstraction for storing a current session or offer control of a namespace in the localstorage #2095
Comments
and update here? |
Is there any change required to make this fix happen? This is a huge limitation for same-domain solid apps |
Hi @Maximvdw , I'm sorry this hasn't been replied to. Currently, there is no support for same-origin apps, as these would end up sharing resources in the browser that are partitioned by origin and we want to keep isolated. Storage is one such resource. I understand this feature request is a workaround that limitation, but two apps under the same origin would still be able to go into each others local storage, even if we had a namespacing mechanism which would only make this work on the happy path. Supporting same-origin apps is not on the roadmap, so I don't think this issue will be fixed anytime soon if ever. |
Apart from same-origin apps, I found this problem also when writing an application that manages two different oidc contexts. Maybe a simple change of this prefix with a more specific one for solid-client-authn-js will at least solve this problem, whitout the need to add support for same origin apps or the ability to set a dynamic prefix. At least documentation should mention this as 'oidc' really is a common prefix to use. |
@Chiyo-no-sake this is most probably caused by us using a fork of May I ask why you are using two OpenID client libraries side-by-side? |
I need my user to log in both to their SOLID Pod via this library and to the company's IDP via |
Search terms you've used
currentSession, prefix localstorage, localstorage, sub diretory,
Impacted package
Which packages do you think might be impacted by the bug ?
Bug description
I have a use case where I have 2 or more solid apps in the same domain under a different path. Each app uses
localstorage for session management with a unique prefix (e.g.
app1.string.solidClientAuthenticationUser:...
). This works fine apartfor the currentSession in combination with the
restorePreviousSession
option. Logging in to another application will cause the restore session to fail for other apps in the domain.According to the description:
solid-client-authn-js/packages/browser/src/Session.ts
Lines 227 to 233 in 3fd7bb4
the reason for not using the storage abstraction layer is because of the browser-only context where
this current session is stored. However, as a developer there is no control with this decision.
There is also no way to change the namespace of the localstorage to include a prefix.
To Reproduce
/app1
,/app2
)/app1
withrestorePreviousSession
enabled/app2
with ``restorePreviousSession` enabled and log in/app1
again, you will have to log in againExpected result
I would expect
solid-client-authn-browser
to use the storage method that is provided, or to have some control in the key that is used (i.e. a prefix). Developers are also not able to handle the storing of a current session themselves due to the unexportedsilentlyAuthenticate
.Personally I feel that it should use the provided storage method - as this method is used to find the session information
solid-client-authn-js/packages/browser/src/Session.ts
Lines 350 to 368 in 3fd7bb4
Actual result
The client library has full control over the key causing unexpected behaviour as mentioned in the bug report.
Environment
The text was updated successfully, but these errors were encountered: