Correct use of refresh token #677
-
|
Hello everyone, I can login with the Captcha Token, save the GCID and reuse it on the second login. Continue session with refresh_token and gcid saved. async def continue_session_with_saved_account(refresh_token, gcid): Initial login with hCaptcha token. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Some basics:
As long as the If for some reason (e.g. because you restarted your script) the The alternative is saving this data to a file and loading from it before trying to set up. You can find some inspiration in the CLI module, with
|
Beta Was this translation helpful? Give feedback.
-
|
Absolutely right! Thanks for the tips, I missed knowing the basic process of renewal All working now! Thanks again for your efforts on this |
Beta Was this translation helpful? Give feedback.
Some basics:
bearer_token(the token used for connecting to the API and you get after login) is valid for 1 hourrefresh_tokencan be used to get a newbearer_tokenfor another hour (and you get a new refresh token). therefresh_tokencan only be used onceAs long as the
MyBMWAccountobject is in Python memory, you don't have to worry, as the library will take care of it.If for some reason (e.g. because you restarted your script) the
refresh_tokenis not available anymore, you will need to use another login with captcha.The alternative is saving this data to a file and loading from it before trying to set up. You can find some inspiration in the CLI module, with
args.oauth_storeis ap…