Skip to main content
Solved

Limit OAuth 2.0 to specific folder_id during authorization


Hi there,


I would like to know is it possible to limit the OAuth authorization to specific folder much like how the scopes parameter works:


https://account.box.com/api/oauth2/authorize?response_type=code&client_id=ly1nj6n11vionaie65emwzk575hnnmrk&redirect_uri=http://example.com/auth/callback&folder_id=somefolderid

Best answer by smartoneinok Box

It does seem like there is some functionality to do this… but it is not in our documentation. Let me know if you have any issues using it in practice.


https://{{account.box.com}}/api/oauth2/authorize?response_type=code&client_id=INSERT_CIIENT_ID&redirect_uri=http://example.com/auth/callback&folder_id=INSERT_FOLDER_ID

View original
Did this topic help you find an answer to your question?

3 replies

smartoneinok Box
Forum|alt.badge.img

Hey -


Thanks for posting on the forum! I don’t think so…at least not in that way since OAuth 2.0 is meant to basically provide access to any content you have access to… but I could be wrong. I’ve never tried. Let me confirm with some folks and report back.


I know you can downscope a token - which may suit your needs better. Checkout this guide for instructions on that!


Alex, Box Developer Advocate


smartoneinok Box
Forum|alt.badge.img
  • Senior Developer Advocate
  • 181 replies
  • Answer
  • July 18, 2023

It does seem like there is some functionality to do this… but it is not in our documentation. Let me know if you have any issues using it in practice.


https://{{account.box.com}}/api/oauth2/authorize?response_type=code&client_id=INSERT_CIIENT_ID&redirect_uri=http://example.com/auth/callback&folder_id=INSERT_FOLDER_ID


  • Author
  • New Participant
  • 1 reply
  • July 18, 2023

Hi there,


Thank you for providing me feedback, I’ll and it and see how it goes from there.


Cheers


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings