XCP-NG API token
-
Is there a way to make the expiration date of the API token provided by XCP-NG infinite?
-
@yeopil21 you're probably thinking of the xen orchestra token
it can be inifinite but you can customize the duration : authentication.maxTokenValidity in your config file -
/etc/xo-server/config.toml
/opt/xen-orchestra/packages/xo-server/.xo-server.tomlWhat items should I look at in the config settings file?
-
@yeopil21
I would add a file config.tokenValidity.toml in /etc/xo-server with this content[authentication] defaultTokenValidity = '1 year' maxTokenValidity = '1 year' -
@florent, I had to do the same for Xen Orchestra Community Edition. In my case, config.toml already contained the [authentication] section, so adding a separate config.tokenValidity.toml file did not work.
Instead, I had to modify the existing config.toml located at /opt/xo/xo-server.
In my opinion, it is best to keep defaultTokenValidity set to 30 days as a fallback in case no value is specified. You can then simply increase maxTokenValidity to the duration you prefer.
[authentication] defaultTokenValidity = '30 days' # default value of 0.5 years # comment out and increase to 5 years #maxTokenValidity = ' 0.5 year' maxTokenValidity = '5 year'