Bugfix/#48 new authentication flow#49
Conversation
slight refactoring added tenacity dependency for "retry" behaviour
added global BASE_URL use global base url to refresh token refactoring
read token_data from memory or file system depending on the current config added Authentication info to README test fix
fixed typo
…fresh will result in a new token request added logging
|
Although the mixed use of the |
|
Is there a way to refresh the token after expiry (899 seconds) using the |
|
Yes it is. From my understanding thats the way it is supposed to be and how it is implemented in this library. We dont know exactly how long it is possible though since this is not specified in the jwt specification and is hard to test as well. |
|
Okay then. Seems, that the token doesn't hold longer than a day (i've tested your library yesterday and today, i had to re-log-in). |
|
If you want to keep the login I recommend you execute some call at least every 30 minutes or so. This should keep the token valid forever. |
|
Makes absolute sense. Ty for the hint. |
fixes #48
This PR implements the new 2FA required by N26.
To prevent having to reapprove every single CLI command a new config option has been added to specify a file path where access token data can be saved on the file system. This config option is optional though and by default
None. If this config option is not set the token data will only be stored in memory and never written to disk.After issuing a command without a previous authentication attempt the user has 60 seconds to approve the login using his paired phone and N26 app. To implement a simple "retry" logic I added the
tenacitydependency.