Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Feature Request - Persistent Tokens for Services #619

Open
nguyenlinhlinh opened this issue Mar 31, 2022 · 5 comments
Open

Feature Request - Persistent Tokens for Services #619

nguyenlinhlinh opened this issue Mar 31, 2022 · 5 comments
Labels

Comments

@nguyenlinhlinh
Copy link
Contributor

Issue Name

Persistent Tokens for Services

Summary

At MAXIV and maybe also at other facilities we use functional accounts for different purposes. These services needs to log in with username and password to get a token every time they wants to push something to SciCat. I wonder if it is possible to get persistent token for there services.

@stephan271
Copy link
Member

One could extend the lifetime of the tokens generated. I dont know if there is a built in limit for this currently.

@dylanmcreynolds
Copy link
Member

@stephan271 the server appears to have an expiresIn configuration for this. https://github.com/SciCatProject/backend/blob/b8eeeb007c71a6bafa79af79db70775c788479af/server/boot/JWT.js#L6

@henrikjohansson712
Copy link
Contributor

@nguyenlinhlinh If I remember it correctly, if you sign in, the token you get back is valid forever, unless you sign in again with that same account. If that's not the case, here's how to set it up: https://stackoverflow.com/questions/32738285/creating-permanent-accesstoken-in-loopback

@nguyenlinhlinh
Copy link
Contributor Author

Thank you everyone for the input. Thank @henrikjohansson712, I will check it out.

@nguyenlinhlinh
Copy link
Contributor Author

I tried to generate persistent token by logging in with ttl: -1 and it didnt work. I can see in the db that ttl is set to -1 but after a week I tried to request proposals I got 401.
{"username": "archiveManager", "password": "xxxxx", "ttl": -1}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants