Skip to main content

Integrating Box.com into my React application

  • November 15, 2023
  • 3 replies
  • 216 views
Integrating Box.com into my React application
user135

Hello everyone,

I’m integrating Box.com into my React application. When I redirect users to this URL

for Box login,


const boxAuthUrl = `https://account.box.com/api/oauth2/authorize?response_type=code&client_id=${encodeURIComponent(CLIENT_ID)}&redirect_uri=${encodeURIComponent(BOX_REDIRECT_URI)}


i’m facing an issue with some accounts. Often, when the user is redirected, they end up at a different URL.


How can I resolve this issue? Can anyone help?

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

3 replies

rbarbosa Box
  • Developer Advocate
  • 553 replies
  • November 15, 2023

Hi @user135


I have this behavior when I’m developing in my machine and I have another box account logged in the browser.


Log out from box or close the browser.


Not sure if this is your use case, let us know


Cheers


user135
  • Author
  • New Participant
  • 1 reply
  • November 16, 2023

Hello @rbarbosa

This issue occurs when a user’s account has two-step verification enabled, sometimes it redirects to this URL. How can i fix this issue?


rbarbosa Box
  • Developer Advocate
  • 553 replies
  • November 16, 2023

Hi @user135


If I’m understanding the problem, it should work just the same, the problem seems to be the multiple cookies and sessions.


Here is a video of a python sample app testing OAuth 2.0 authorization:




Let us know if this helps.


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