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
Victor HuaVictor Hua 

how to properly display salesforce login after OAUTH_APP_ACCESS_DENIED

We are using REST API to authenticate user. It works pretty well, until we changed setting "Permitted Users" in the connected Apps to 
"Admin approved users are pre-authorized"

Our app still works for "approved users", but for un-approved users, OAuth calls back to the "callback URL" with error:

https://our_web_app.com/loginsuccessful?error=OAUTH_APP_ACCESS_DENIED&error_description=user+is+not+admin+approved+to+access+this+app&state=%2F

Since this is an error, our app redirects to the salesforce login page, but saleforce redirect to the above callback url immediately, it becomes an infinte loop.

The question here is how to properly display salesforce login again to correct username/password