ensure that the params are present
generate token for the user