You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to find something about this in the documentation and the source code (so I apologise if I missed something), but it would be useful to have a method for testing whether the token has expired, and also update the token if needed.
I tried to use the ping endpoint of the sea file api, but it seems like It does not require a valid token.
Other ideas or suggestions for best practices are also appreciated.
The text was updated successfully, but these errors were encountered:
edit: it seems you are referring to th token issued by seafile, and not by ebrains IAM. Please ignore the original post.
since the token is a standard JWT token, one could decode it with something like:
importjsonfrombase64importb64decodeimporttimeauth_token="ey..."tolerance=30# if expires within 30seconds_header, body, _sig, *_rest=auth_token.split('.')
exp=json.loads(b64decode(body.encode("utf-8") +b"====").decode("utf-8")).get("exp")
ifexp-time.time() <tolerance:
raiseebrains_drive.exceptions.TokenExpired(e.code, 'The token has expired')
I tried to find something about this in the documentation and the source code (so I apologise if I missed something), but it would be useful to have a method for testing whether the token has expired, and also update the token if needed.
I tried to use the ping endpoint of the sea file api, but it seems like It does not require a valid token.
Other ideas or suggestions for best practices are also appreciated.
The text was updated successfully, but these errors were encountered: