Skip to main content
Question

Box JS SDK FilePicker Does Not Send Access Token In the API

  • May 27, 2025
  • 2 replies
  • 8 views

Forum|alt.badge.img

I'm getting 401 and what I've stumbled on is that there is no authorization header with a token set in the header in the api call

leqtjIXD_ZsRuYhj7jNsgD5Fg.png

I compared my pre-flight to the demo and it seems that in my pre-flight request there is no authorization header in the list in  Acces-Control-Allow-Header; therefore in the subsequent API call my browser does not send the bearer token.  Why is authorization missing from the list???

aywvFdttaU5GDgkvomkfiDz5A.pngimc0oY10ZmVJeJ9aeyvefHhGQ.png

I'm using Box ContentPicker's latest vision via CDN following this guide https://developer.box.com/guides/embed/ui-elements/picker. Please advise!

 

2 replies

Forum|alt.badge.img
  • Author
  • Known Participant
  • 34746 replies
  • May 27, 2025

Can I get an update on this? Just to reiterate the issue, I'm not sure why there is no authorization header set in the preflight request. If I manually added the token myself the API works just fine. I'm not sure why the lib is skipping it in my case.

 

ait9DILiZC_tbov63nlTGNUyQ.pngpaqgDqB_O2ylQuLfWMeZVUEAg.png

 


Forum|alt.badge.img
  • Author
  • Known Participant
  • 34746 replies
  • May 27, 2025

HI Scott

Can you share the actual HTML where you load the picker in your page? You always need to provide a token and a folder id for it to load

Rgds,

Peter Christensen, Platform Solutions Engineer, Box