Repository navigation
Need help with powershell and the new way to refresh token #499
|
Hi, since the way of getting tokens is changing i need to implement the refresh token in my desktop application (it is for personal use). I was using python to get results but now i have using powershell to get results and it s working but i'm struggling to get the "refresh_token" in use. So i have the following script It does not work iu get a "The remote server returned an error: (400) Bad Request.". Now my problem here is that i'm confused about the $url. When i do this from the console of https://trakt.docs.apiary.io/reference/authentication-oauth/get-token/exchange-refresh_token-for-access_token It works perfectly, i first get the access code from the activation page and then as many times as i need i get the refresh_token and the access_token. Now if i use this as an $url variable and run my script it worked (one time) but i assume the number is a hash and it is changing always. So what am i doing wrong. using the same powershell with get and correct acess code i get results with no problem, meaning my script below which i paste the access code works I Get Results....... Can you help please to solve this out. |
Replies: 1 comment 12 replies
|
I'm not 100% sure what the issue is but if you're trying to refresh your token using the same If you can include your full error response including body and headers (other than removing any secret ids etc) that might help. eg. if you try to refresh using an already used {
"error": "invalid_grant",
"error_description": "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."
} |
I'm not sure what the problem in your script might be, but I think it's the missing conversion to JSON of the body values. I think it's the only difference.
I got no issue with this Powershell script, which is a 1:1 translation of your Python script.