Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh token #61

Closed
benthehorn opened this issue May 22, 2019 · 3 comments
Closed

Refresh token #61

benthehorn opened this issue May 22, 2019 · 3 comments

Comments

@benthehorn
Copy link

benthehorn commented May 22, 2019

Just for information, the refresh token can be used to get a new token, without needing username/password after the initial login. You just need to keep it refreshed before you reach the expiry time.
`def refresh_token():

device_id = "alongdeviceid"
url = "https://jlp-ifas.wirelesscar.net/ifas/jlr/tokens"
payload = {
    "grant_type": "refresh_token",
    "refresh_token": "arefreshtoken",
}
headers = {
    "Authorization": "Basic YXM6YXNwYXNz",
    "Content-Type": "application/json",
    "X-Device-Id": device_id,
}
res = requests.post(url, headers=headers, json=payload)
json_response = res.json()
print(json_response)`
@ardevd
Copy link
Owner

ardevd commented May 22, 2019

Cool! Nice find. That's actually very useful!

@ardevd
Copy link
Owner

ardevd commented May 30, 2019

@benthehorn have you actually gotten this to work? The request does indeed return a new access token and refresh token but subsequent requests where you actually use that new access token seems to return a 401 for me.

@ardevd
Copy link
Owner

ardevd commented May 30, 2019

Nevermind. You need to register the device id and log in the user after refreshing the access token and then it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants