build secure token method