Skip to main content

Grant page is shown everytime

Grant page is shown everytime

Hi, the grant page shown below appears everytime the user wants to use box. Is this the expected behaviour or is it my incorrect setup?


Screenshot from 2023-11-02 18-24-07

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

3 replies

CodeBoxSeb
  • Participating Frequently
  • 58 replies
  • November 2, 2023

Hi @user112


Did you change the app settings between each attempt to log in ?

I think you can get this pop-up if you change the app settings in between. Especially if you change the scopes.


  • Author
  • New Participant
  • 4 replies
  • November 3, 2023

I encounter this pop-up every time I log in. Although I made changes to the app settings once, I have logged in multiple times, and this pop-up has consistently appeared. Is there a particular setting I might have overlooked?


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

Hi @user112


Most likely your app is not re-using the tokens given in the first authorization.


So the first time the user authorizes the app, and you get that screen.


In that process your app gets an access token and a refresh token, valid for 60 minutes and 60 days. You should store these tokens somewhere safe.


The second time, your app needs to get the tokens from before.


If the access token is still valid (< 60 minutes) then just use that.


If not, but the refresh token is still valid (<60 days), then use that token to get a new access token. Your app will also get a fresh new refresh token. Store these again, and use the access token


If your refresh token is expired, your app needs to go through the authorization process again.


Not sure if python is your things, but here is a sample app template that implement OAuth:



Let us know if this helps.


Reply


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