Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Curious about API key Session timeout
« previous
next »
Print
Pages: [
1
]
Author
Topic: Curious about API key Session timeout (Read 1511 times)
Jonathan
Newbie
Posts: 3
Karma: 0
Curious about API key Session timeout
«
on:
August 17, 2023, 04:19:00 am »
Hello everyone,
As a newcomer to OPNsense, I have a question regarding to the API key session timeout. Despite my efforts, I haven't come across any details in the documentation, and I was wondering somewhere in OPNsene has an explicit session timeout setting for API keys. Specifically, I'm curious to know how long the session timeout duration is for API keys before they expire.
If anyone could provide some feedback about this topic, that would be greatly appreciated! Thank you in advance for your help.
Logged
franco
Administrator
Hero Member
Posts: 17665
Karma: 1611
Re: Curious about API key Session timeout
«
Reply #1 on:
August 17, 2023, 12:52:35 pm »
What's your session concern here? Since the API keys require to be pushed always there isn't much an attached session will do so when it times out a new one is created. But this should not matter from the caller side.
Cheers,
Franco
Logged
Jonathan
Newbie
Posts: 3
Karma: 0
Re: Curious about API key Session timeout
«
Reply #2 on:
August 17, 2023, 04:56:52 pm »
Thanks for the reply Franco,
Sorry I'm still trying to grasp how API key works, so my concern is "If I have an existing API key that was generated some time ago, would using that key for a new API request still provide me with access?"
Thanks again!
Jonathan
Logged
franco
Administrator
Hero Member
Posts: 17665
Karma: 1611
Re: Curious about API key Session timeout
«
Reply #3 on:
August 17, 2023, 05:45:13 pm »
Hi Jonathan,
API keys are much like user/passwords, but they are not meant to log in and do stuff (in the session) but rather meant to be passed by a script for each single operation. That means sessions are irrelevant since you are practically logging in for each operation.
API keys will not stop working by themselves but their privileges can be adjusted or completely revoked so that the scripts using them will stop being able to do what they are supposed to (because it's no longer necessary or an API key has been compromised for example).
API keys also only work on the API pages, but not the GUI (I'm not 100% sure but for static PHP pages that is true). In that sense they replace the GUI use altogether.
Cheers,
Franco
Logged
mimugmail
Hero Member
Posts: 6766
Karma: 494
Re: Curious about API key Session timeout
«
Reply #4 on:
August 17, 2023, 08:17:25 pm »
I also saw them when logged in via browser for ages and system alteady rebooted
Logged
WWW:
www.routerperformance.net
Support plans:
https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German):
https://opnsense.max-it.de/
Patrick M. Hausen
Hero Member
Posts: 6839
Karma: 574
Re: Curious about API key Session timeout
«
Reply #5 on:
August 17, 2023, 09:34:10 pm »
Repeating franco a bit ...
An API key - no matter if it's OPNsense or e.g. github - is a
permanent
authentication token. Like an SSH key. Once generated and authorized it never changes and there is no "session".
The administrator of whatever application we consider can of course revoke any issued API key any time.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
Jonathan
Newbie
Posts: 3
Karma: 0
Re: Curious about API key Session timeout
«
Reply #6 on:
August 18, 2023, 02:49:59 am »
Beginning with sincere gratitude, I wish to express my thanks to Franco and all the other contributors who have generously shared their answers on this forum, which has undoubtedly proven to be immensely beneficial.
I Look forward to further interactions and discussions on the forum!
Warm Regards,
Jonathan
Logged
franco
Administrator
Hero Member
Posts: 17665
Karma: 1611
Re: Curious about API key Session timeout
«
Reply #7 on:
August 18, 2023, 07:32:40 am »
We are here to help after all
Thanks,
Franco
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Curious about API key Session timeout