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
OAuth2 refresh token issue #777
Comments
@antusus @mhagmajer @lukaszsocha2 @mwwoda |
Hi @skchronicles,
Let me know if you managed to resolve this issue. |
Hey @lukaszsocha2, I hope you're having a great start to the new year. I will check out the documentation for the Client Credential Grant, and I will let you know if I run into any problems. Thank you for your help! Best Regards, |
Hey @lukaszsocha2, Is it possible to refresh a developer token? They have a relatively short lifespan. |
Hi @skchronicles, First, let's clarify what a developer token is. Please take a look at this link: https://developer.box.com/guides/authentication/tokens/developer-tokens/. As you can see, a developer token should be used during development and testing, not in production environments. When it expires, you should generate a new one on the developer console. There is no programmatic way to refresh it. Instead of using a developer token, you can use either OAuth, CCG, or JWT authentication. The simplest one is CCG. Please take a look at our documentation here: https://github.com/box/box-python-sdk/blob/main/docs/usage/authentication.md#obtaining-user-token. Please let me know if that helped Regards, |
This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed. |
This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Python SDK and feel free to open another PR/issue at any time. |
Hello there,
Description of the Issue
I am running into some issues related authentication using OAuth2. It appears my refresh token is not getting refreshed, like the
store_tokens
callback is doing nothing or the.refresh()
method does not do anything.Steps to Reproduce
Here is an example script,
auth.py
:Here is an example config file,
config.toml
:Here is example usage of the script:
Expected Behavior
I was hoping the token would get refreshed and saved in the config file. I am not sure of the best way to get a refresh token. From http://developers.box.com/, I only see a Developer token option. I have been using an access_token and refresh_token that I generated for connecting Box to Rclone. With that being said, I got this script to work a few times by running Rclone and then copying the new
refresh_token
andaccess_token
Rclone updated in its config file. That worked a few times, and then it randomly stopped working. The tokens provided to the python-sdk are the same tokens that Rclone is using. Rclone works fine with those tokens.Is there a way to refresh a developer token in a headless manner (working on a remote server)? Similar to how this OAuth2 refresh is supposed to behave? I just need a token to programmatically interact with Box, that I can refresh without a browser getting involved. It seems like Rclone has figured this out. If I checkout the config file it uses, it automatically gets updated when the token expires. Also, it is possible to create a token with a longer life span, say like a year or so. I will be using this token to programmatically interact with files I own on Box.
Error Message, Including Stack Trace
Here is the error:
Versions Used
Python SDK: 3.5.1
Python: 3.8
The text was updated successfully, but these errors were encountered: