Skip to main content
user135
New Participant
Nov 15, 2023 8:49 AM UTC

Integrating Box.com into my React application

Integrating Box.com into my React application

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?

3 replies

rbarbosa Box
Developer Advocate
Nov 15, 2023 6:33 PM UTC

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

Translate
user135
user135Author
New Participant
Nov 16, 2023 8:35 AM UTC

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?

Translate
rbarbosa Box
Developer Advocate
Nov 16, 2023 9:20 PM UTC

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.

Translate