replace token by token identifier
return token identifier
generate a token for the user (not tested yet)