Extend key lifetime

Extend key lifetime

by Paul Garratt -
Number of replies: 2

Hi everyone

Can someone point me in the direction of how to extend my networking key lifetime, its at 30 days but I have a hub with over 100 moodles and need it to either auto update, never expire or at least be 120 days?

Cheers

Average of ratings: -
In reply to Paul Garratt

Re: Extend key lifetime

by Nigel McNie -
Hi - if I recall correctly, there is a configuration setting for how long the key will last for. I can't remember what it's called in Moodle, but I think it's only settable in config.php. Howard Miller would know, he's the one who added it wink
In reply to Nigel McNie

Re: Extend key lifetime

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It's in config-dist.php...

// Change the key pair lifetime for Moodle Networking
// The default is 28 days. You would only want to change this if the key
// was not getting regenerated for any reason. You would probably want
// make it much longer. Note that you'll need to delete and manually update
// any existing key.
// $CFG->mnetkeylifetime = 28;

If you are linking to Mahara there's no equivalent so that would need an 'easy' hack. You won't find the number 28 in the code in too many places smile

Whatever, make sure you extend the key at both ends or there isn't a lot of point.

Does this mean that key swapping isn't working still in some situation?