# Automatically generate validationKey and encryptionKey when they are not set

**URL:** <https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355>\
**Category:** Development\
**Tags:** proposal\
**Created:** [October 25, 2023, 6:18am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355 "2023-10-25T06:18:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [October 25, 2023, 6:18am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355/1 "2023-10-25T06:18:51Z")

</div>

Hi everyone,

It’s super easy to forget to set those two properties, and it’s also a bit of a pain to have to implement something to generate them in each package (Docker, Debian, Snap, etc.).

So I would like to propose to handle them differently:

1. stop providing values for them in the generated xwiki.cfg

2. if they are not already set:

WDYT ?

---

<div class="post-metadata">

**Author:** ![mflorea](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mflorea/32/49_2.png) [@mflorea](https://forum.xwiki.org/u/mflorea)\
**Post date:** [October 25, 2023, 6:53am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355/2 "2023-10-25T06:53:57Z")

</div>

Sounds good, +1.

Thanks,  
Marius

---

<div class="post-metadata">

**Author:** ![acotiuga](https://forum.xwiki.org/user_avatar/forum.xwiki.org/acotiuga/32/3815_2.png) [@acotiuga](https://forum.xwiki.org/u/acotiuga)\
**Post date:** [October 25, 2023, 6:55am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355/3 "2023-10-25T06:55:11Z")

</div>

+1

Thanks,  
Alex

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [October 25, 2023, 6:58am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355/4 "2023-10-25T06:58:52Z")

</div>

+1 Thanks

---

<div class="post-metadata">

**Author:** ![surli](https://forum.xwiki.org/user_avatar/forum.xwiki.org/surli/32/2687_2.png) [@surli](https://forum.xwiki.org/u/surli)\
**Post date:** [October 25, 2023, 7:18am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355/5 "2023-10-25T07:18:43Z")

</div>

+1 thanks

---

<div class="post-metadata">

**Author:** ![MichaelHamann](https://forum.xwiki.org/user_avatar/forum.xwiki.org/michaelhamann/32/3813_2.png) [@MichaelHamann](https://forum.xwiki.org/u/MichaelHamann)\
**Post date:** [October 25, 2023, 7:55am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355/6 "2023-10-25T07:55:59Z")

</div>

+1. Note that there is an existing, 10 year old pull request that implements this and stores the keys in a key store: [XWiki 5406 by tdelafosse · Pull Request #90 · xwiki/xwiki-platform · GitHub](https://github.com/xwiki/xwiki-platform/pull/90)

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [October 25, 2023, 8:16am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355/7 "2023-10-25T08:16:31Z")

</div>

> [@MichaelHamann](#):
>
> Note that there is an existing, 10 year old pull request that implements this and stores the keys in a key store: [XWiki 5406 by tdelafosse · Pull Request #90 · xwiki/xwiki-platform · GitHub](https://github.com/xwiki/xwiki-platform/pull/90)

OK, thanks, I missed this one since the title of the issue did not seem that close. It’s also going a lot beyond what is discussed here, which does not really change anything to the system and just store the two values in a properties file located in the permanent directory (that could be used for other generation needs like this).

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [October 25, 2023, 8:29am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355/8 "2023-10-25T08:29:38Z")

</div>

+1 thanks. FTR it’s [Loading...](https://jira.xwiki.org/browse/XWIKI-542)

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [October 31, 2023, 6:33am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355/9 "2023-10-31T06:33:40Z")

</div>

7 +1 and not other vote

Applied in 15.9, 15.5.4 and 14.10.19.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [October 31, 2023, 9:45am UTC](https://forum.xwiki.org/t/automatically-generate-validationkey-and-encryptionkey-when-they-are-not-set/13355/10 "2023-10-31T09:45:10Z")

</div>

Very good! Thanks for working on this, it’s great.
