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
Authentication Issue #744
Comments
Hi @ericasaw,
Have you went through all steps from this page? Especially have you done step: App Authorization? JWT requires submitting your application and your Box enterprise admin approval. Without your app being approved you cannot use JWT auth. Also the easiest and recommended way to use JWT auth is to just pass path to your config file as the only parameter. The class will extract all required fields. So the code that it is recommended to use will be:
Same issue as with JWT. Have you fulfil all Prerequisites described here? CCG also requires approving your application by the admin.
This is the only method which does not require admin approval (except developer token), but will require from you to press "Grant Access" button each time you want to use it. All required steps are described here: Overview. The redirect step depends on a framework you use. Some time ago I wrote a small flask app, which does Oauth authentication and list all files in your root folder. You may find it useful:
To make it work you have to set Also: To summarise: think which auth type do you want to use, create an app with authentication type you have chosen and try to go through all steps described in developer guides (https://developer.box.com/guides/authentication/). If this answer won't solve all your concerns, don't hesitate to ask again. |
Hi Lukas, |
Hi @ericasaw, |
Hi Lukas, |
Hi @ericasaw, |
Hi Lukas, |
See example here https://www.codegrepper.com/code-examples/python/change+port+flask |
Hi Lukas, |
Hi Lukas,
I get the following error "TypeError: The view function for 'callback' did not return a valid response. The function either returned None or ended without a return statement." because I don't have a return for the callback function, but I don't really need one for my specific application. Or did I build the function wrong? should I just be returning the client to the script and then generating the permanent download links? |
@ericasaw So maybe can you just make callback() return empty string? I also don't understand why don't you try to create new app with CCG or JWT auth method and get your app authenticated. The usage of these auth methods will be much easier than OAuth2 and won't require your interaction during authentication process. |
Hi Lukas, |
@ericasaw but also did you try to make callback() return empty string? |
Can you tell me on which line does your code throws exception with JWT? Is it |
It is only when I try to use the user_client that that specific error is thrown. If I just try to use the client I get a different error that says the ID (corresponding to the folder that holds all the data) doesn't exist. Haven't tried to make callback return an empty string yet. |
Okay! App is resubmitted for approval, I'll update you when it's approved. |
Hi Lukas! I tried copying the old key pair into the new .json file and I still get the same "Code: access_denied_insufficient_permissions" error from before even with the make API calls using the as-user header checked in the box developer app. |
Hi,
Let me know if it worked. |
Hi Lukas, |
My CCG app was approved as well so I tried authenticating using the information from that app with:
but I get the following error:
I'm not sure what an internal service error indicates, do you have any ideas? |
ericasaw, the "Internal Server Error" is a different issue than the auth issue in the issue description. However, I'd like to state that we are also receiving this error. There are some intermittent issues going on with the Box servers right now if I had to guess.
|
Okay good to know! I wasn't sure if it was related to me setting up my app wrong, I might just try to run the CCG Auth again tomorrow to see if things are fixed. |
Okay the CCG Authentication method seems to work this morning! Thank you all so much for your help. I still cannot get the JWT Auth to work, maybe it is a university limitation? I am open to trouble shooting that further since it seems like the preferred authentication method. |
Hi, @ericasaw @lukaszsocha2 I'm facing the same problem again and again. Can you help me with that? I used JWT but getting permission denied errors and with CCG I'm getting Grant credentials are invalid. |
hi @kailashlimba1997 , To make JWT and CCG apps works, you need to authorize your app. If your app is not yet authorized, click Review and Submit to ask the Box Enterprise administrator for approval. Please let me know about the result |
Hi, @arjankowski Thanks for replying. I've authorized the application and enable status is also enabled. Still, I'm facing this issue. |
Hi @kailashlimba1997,
I hope that works! I was never able to figure out the JWT Auth and the Box team has not been very responsive when I reached out through the support channels so I just gave up trying to use that method. |
Hi @ericasaw @arjankowski After writing the below code from boxsdk import Client, CCGAuth auth = CCGAuth( client = Client(auth) events = client.events().generate_events_with_long_polling() I'm getting this error, message Message: Grant credentials are invalid |
HI @kailashlimba1997, |
Yes, I write in inverted commas. Can I have your contact and discuss this issue on zoom/meet? |
@kailashlimba1997 since I am not a box developer I am not really comfortable meeting or spending a ton of time helping with resolving issues like these. Hopefully one of the developers in this thread can help! |
Hi @antusus @mhagmajer @cristynkells @lukaszsocha2, can anyone help me with the above issue? |
@kailashlimba1997 |
No, the error is still not resolved. I've emailed you on ajankowski@box.com for a call. |
If you haven't received the email, please ping me at kailash@nroadcorp.com whenever you get time. |
Thanks, @arjankowski. The CCG credential (for the user) worked for me. |
Description of the Issue
I've been having issues with Box authentication through Python since I started using it. I am trying to use the Box Python SDK to generate permanent download links for thousands of files. I have figured out how to generate all of the links, but unfortunately when I first generated them they were not permanent. I now need to go and update all of the links, but the first time I did this, due to all of my authentication issues, I put in a developer token each hour for many many hours (weeks of time). I don't want to have to do this ever again so I am hoping to solve the authentication issue.
I have tried all of the different authentication methods recommended in the documentation. However, the only method that is successful for me is using the developer token. Here are some of the problems I ran into using various authentication methods:
I’m sorry if this is generally straight forward for other developers to figure out, but I am just a grad student who isn’t really familiar with this type of developer programming and I find the API for all of the Box ecosystem pretty opaque.
I should also note that I have tried all of the above authentication methods with both the initial Box CLI app and another trial app that I generated which allows me to create the downloadable .json files with public/private key pairs.
Steps to Reproduce
All of the lines of code I tried for authorization I directly copied from the SDK auth wiki page and inserted my own user ID, .json file, etc., generated using the Box Developer. This leads me to believe that this might be an issue with setting up the Box Developer side of things--unless that code only works in very specific cases, but if so, then more detailed instructions should be added to the wiki for how to set that up properly so that the sample code will work.
Expected Behavior
Successful authentication that did not require a development token to be put in each hour.
Versions Used
Python SDK: 3.3.0
Python: 3.6.13
The text was updated successfully, but these errors were encountered: