Accommodating the generation of tokens

allow the retrieving of tokens and generating new ones.

This is to allows tokens to be generated by a user or cron so the system
never goes down