[doc][security] use generic token factory in doc examples.