Skip to content
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

[Plugin] Allow access to local storage during authentication #1196

Open
xlash123 opened this issue Jul 29, 2024 · 0 comments
Open

[Plugin] Allow access to local storage during authentication #1196

xlash123 opened this issue Jul 29, 2024 · 0 comments
Labels
Enhancement New feature or request Plugins

Comments

@xlash123
Copy link

Use Cases

I am working on writing a plugin for a platform, but this platform does not use cookies for authentication. Instead, it sets an authentication token inside the browser's local storage. Then for any authenticated API calls, it adds the auth token as a URL query parameter.

Since the current method of plugin authentication relies on cookies, I have no way to extract this token and use in the plugin.

Proposal

Potentially, the configuration could allow for specifying the key name(s) of the desired data to read from the local storage, and then the resulting data is stored in the plugin's config variable, perhaps as config.secrets.<key-name>.

So for example, I could define a configuration as:

"authentication": {
    "loginUrl": "https://example.com/login",
    "localStorageKeys": ["authToken", "someOtherData"]
}

And in the plugin code, I could use it as:

const response = http.GET(`https://example.com/subscriptions?authToken=${config.secrets.authToken}`);

References

No response

@xlash123 xlash123 changed the title [Plugin] Allow accessing local storage during authentication [Plugin] Allow access to local storage during authentication Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Plugins
Projects
None yet
Development

No branches or pull requests

2 participants
@xlash123 and others