function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deepak Hanumantha AndeliDeepak Hanumantha Andeli 

OAuth Error - You didn't complete the approval process before it expired. Please try again

Hi All,

We are currently working on OAuth 2.0 User Agent flow where our Mobile App connects with Salesforce through a Connected App.

Although most of the time, user gets authenticated and authorized accurately. There are some instances where we see OAuth Error page (see the below image) instead of redirecting the User to appropriate redirection page.

We haven't been able to identify the cause for this behavior but we do know that the User trying to authenticate and authorize himself can be
  • New User
  • Existing User
  • Provide Corrector Incorrect credentails.
Any one has come across this behavior and has been able to idenitify the root cause ?


OAuth Error
Best Answer chosen by Deepak Hanumantha Andeli
Deepak Hanumantha AndeliDeepak Hanumantha Andeli
Hi @Avery,

Not sure if it addresses your issue but we were able to find the root cause recently.

 We observed that when user tries to access the OAuth URL (\services\oauth2\authorize) on the client machine (Browser or Mobile App), Salesforce presents a new URL (setup/secur/RemoteAccessAuthorizationPage.apexp?).

It was found that this new URL has an session Id and expires after new minutes of idle time (approx. 10 minutes, not very sure). 

When some one tries to Login after the session Id is expired, system throws the OAuth error as can be seen in my previous post.

All Answers

Avery D'AmelioAvery D'Amelio
Hi there

My co-worker just experienced this issue yesterday. We were unable to solve the issue but found that it has something to do with Chrome. She was able to log into her salesforce account on IE with no issue. If anyone is able to identify the root of this issue or provide a fix please let me know. 

Thank you 
Avery
Deepak Hanumantha AndeliDeepak Hanumantha Andeli
Hi @Avery,

Not sure if it addresses your issue but we were able to find the root cause recently.

 We observed that when user tries to access the OAuth URL (\services\oauth2\authorize) on the client machine (Browser or Mobile App), Salesforce presents a new URL (setup/secur/RemoteAccessAuthorizationPage.apexp?).

It was found that this new URL has an session Id and expires after new minutes of idle time (approx. 10 minutes, not very sure). 

When some one tries to Login after the session Id is expired, system throws the OAuth error as can be seen in my previous post.
This was selected as the best answer
Avery D'AmelioAvery D'Amelio
Hi Deepak Hanumantha Andeli

Thank you for the tip. I found that clearing the cache worked. The user was using a long URL that was trying to redirect the page instead of https://login.salesforce.com/. 
Bruce_DoBruce_Do
Hi all,
I created a connected app and intergrate with a mobile app, This app allow to create a community user and sometime this issue happen
and don't know how to fix. 
Bruce_DoBruce_Do
Hi Deepak Hanumantha Andeli

Do you know where I can increase session timeout. I tried on connected app, profile, session setting but they not affect. 

Regard
Deepak Hanumantha AndeliDeepak Hanumantha Andeli
Hi Do Dang Khoa,

After discussions with Salesforce Support we understood that this session time out period was not reconfigurable. Hence we had to manage this time out through a client side timer logic.
Bruce_DoBruce_Do
Thank Deepak Hanumantha Andeli
But can you show me more specific. As I a Salesforce developer and I don't know how to manage time out at client side (I think Mobile side).
Please show me the example.
Regard
Israel (Izzy) BoydIsrael (Izzy) Boyd
After a week, I've finally solve this issue for one of our employees. Notice the error says that s/he didn't complete the approval process before it expired. He was at the point of having to change his password at every login. The problem was that he had saved the password reset link as his main salesforce login page, instead of https://login.salesforce.com. He wasn't going to the correct login page. The fix was so simple that I never thought of it until today. Hope this works for others too :) 
Bruce_DoBruce_Do
Thank Israel (Izzy) Boyd.
I think this change is on Mobile SDK at Mobile site, isn't it. 
Deepak Hanumantha AndeliDeepak Hanumantha Andeli
Hi Bruce,

Generally what's possible is write a javascript code that calls setInterval method every 15 minutes (session timeout).
If the User does not login before the session times out then reload the URL so that the session is recreated.

Cheers,
Deepak 
Bruce_DoBruce_Do
Thank Deepak Hanumantha Andeli
Could I know, where the session timeout was set? I tried on user profile, connected app, session managerment, but they are not work.
Regard
Deepak Hanumantha AndeliDeepak Hanumantha Andeli
No Bruce, that setting is not available for us to change. It is configured within Salesforce.
Bruce_DoBruce_Do
Thank Deepak Hanumantha Andeli
Do you have any official documment mention to this issue. I need to show this for the team Lead.
Many thank.
Deepak Hanumantha AndeliDeepak Hanumantha Andeli
Sorry Mate! I didnot find any documentation instead I was informed by salesforce support executive.
Kerith KahealaniKerith Kahealani
I have a Chatter Desktop user that keeps getting the same message "We can't authorize you because of an OAuth error. For more information, contact your Salesforce administrator.
You didn't complete the approval process before it expired. Please try again."
She was using the desktop app fine and then one day, all the sudden... she wasn't "online" and there was nothing she could do to get the green button to go on and make her available.  I told her to log out and log back in, which she did however she forgot her password, so she re-set it.  when she went back into the desktop app to use her new password, that's when she got this message.  I am the system admin and have checked her user page and it shows she had a successful online loging but no chatter desktop activity since she was last able to use it.  PLEASE HELP!
Deepak Hanumantha AndeliDeepak Hanumantha Andeli
Not sure if the Desktop Chatter can be uninstalled (assuming the problem still persist).

Seems like the view that was loaded (I mean the login page) had an expired token. If it can be uninstalled then try uninstalling and re-installing the same.

Alternatively suggest you to upgrade to the latest version.

If none of them is possible / works, seek Salesforce Support help.

Cheers,
Deepak
Kerith KahealaniKerith Kahealani
Thanks! the user ended up re-starting her computer and it worked without having to uninstall. very odd.
Laura Anderson 10Laura Anderson 10
@Avery D'amilio - thank you for your suggestion.  Immediate fix.
 
Joe Barone 7Joe Barone 7
In my case, a colleague got the following error when trying to access Salesforce through her mobile app: 
"We can't authorize you because of an OAuth error. For more information, contact your Salesforce administrator. You didn't complete the approval process before it expired. Please try again."
I was able to log in as MYSELF on her phone, so long story short, what fixed the dilemma for her was that I assigned the Profile she was attached to the "API Enabled" setting.  Now she can log in with no problem.
Ashish MalhotraAshish Malhotra
Well, I just tried diffrent browser & it worked