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

Closed
xlash123 opened this issue Jul 29, 2024 · 1 comment
Closed

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

xlash123 opened this issue Jul 29, 2024 · 1 comment
Labels
Enhancement New feature or request Plugins Wont Fix This will not be worked on

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
@grayjay-support-FUTO grayjay-support-FUTO added Enhancement New feature or request Plugins labels Oct 14, 2024
@Zvonimir-FUTO Zvonimir-FUTO added the Wont Fix This will not be worked on label Nov 14, 2024
@Zvonimir-FUTO
Copy link
Collaborator

This is not the best implementation for storing authentication data and users authentication data would be exposed to the developer of plugin which we are trying to avoid.

It would help also if you mentioned the name of the platform and feel free to discuss stuff like that on https://chat.futo.org/

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 Wont Fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants