oidc-client-ts icon indicating copy to clipboard operation
oidc-client-ts copied to clipboard

Add support for StorageArea API

Open Kurolox opened this issue 2 years ago • 0 comments

I'm dealing with a particular use case where I'm using oidc-client-ts in a browser extension that uses multiple content scripts in different domains.

Currently, oidc-client-ts is limited to use the Web Storage API, which is limited to each domain and it's not a good fit for my particular use case (Each domain has their own storage pairs, which means that the token credentials are stored once for each domain rather than having the same token being shared between all domains )

Meanwhile, the StorageArea API allows for an extension to store data in itself, which would allow this kind of use case where a token has to be shared between multiple domains could be implemented.

As far as I can see the only thing needed to implement this change would be to make a few adaptations to the WebStorageStateStore constructor to allow for a StorageArea store parameter, and adapt the API calls to work with them (Everything is pretty much the same as the Storage API, it mostly differs on the naming convention of the methods of the API)

I'm willing to make the contribution myself, but I'd like to double check beforehand if this is fine before working on it.

Kurolox avatar Sep 20 '23 07:09 Kurolox