Skip to content

Add support for StorageArea API #1180

@Kurolox

Description

@Kurolox

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions