first implement of getaccesstoken