-
Notifications
You must be signed in to change notification settings - Fork 674
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
Make token duration configurable #1008
Comments
+1 on this issue 🎊 I'm part of a Open-source IoT meta platform project and we are building an orchestrator service on top of Mainflux. For reasons mentioned in issue #778, we've attempted using Our motive is that we need our orchestrator service to be able to make operations that require the Let us know if there is any way we can work to collaboratively address this issue 🎊 |
@lcbm best would be that @dusanb94 and/or @nmarcetic leave you the instructions here or on Gitter, and you try to implement this and send PR. It should not be so difficult. |
This is possible using API keys for this purpose. There are 2 types of keys issued for the user: user key and API key. User key you get on login and it lasts default 10h. An API key is similar to the user key (it's also a JWT), but you can specify duration for it or, if you leave duration empty, the API key will last indefinitely. Unlike user keys, API keys can be revoked, thus indefinitely duration is not the problem. |
Just to add ^ Currently with API keys you can do provisioning ( device, channels CRUD) but not messaging (you can't send messages as device or user). We will add messaging in future |
@drasko awesome! We'd be more than glad to do it 😄 @dusanb94 @nmarcetic thanks for taking some time to help us! Just to try to make our point clearer, tho: we did try using API Keys and from what was discussed on Gitter, we concluded that we must, for now, rely on User Key (or User Access Token). We were able to create an API Key but it seems to not be associated with a user (we also had some weird behavior)... 👇 What we were able to do, following authn's swagger.yaml specifications:
Get an API Key
What we were unable to do, following authn's swagger.yaml specifications: Get Things w API Key
If you have any further guidance, instructions, or anything that could help us use API Keys properly, that would be awesome. We'll be glad to help in any other way, to open issues or anything necessary to give further details. From our experience and previous discussions, we were only abe to use User Keys 😢
|
We have this covered by unit tests and everything works as expected ^ This must be some problem in usage (wrong documentation or similar). @dusanb94 Can you pls take a look at this ^ |
We should also add some token refresh mechanism |
Working on this |
FEATURE REQUEST
Describe the feature you are requesting, as well as the possible use case(s) for it.
Make duration configurable for different types of API keys. Currently, login and recovery key durations are hardcoded constants.
Indicate the importance of this feature to you (must-have, should-have, nice-to-have).
This is a should-have feature.
Originally posted by @nmarcetic in https://github.com/mainflux/mainflux/pull/1007
The text was updated successfully, but these errors were encountered: