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
Rohit Jadhav 12Rohit Jadhav 12 

How to auto approve Salesforce REST API OAuth2 authorization_code flow to not show allow access pop-up.

Currently, I am using OAuth2 authorization code flow to authenticate REST services, but when I am doing request to get authorization code like this
 https://login.salesforce.com/services/oauth2/authorize?
 client_id=3MVG9IHf89I1t8hrvswazsWedXWY0i1qK20PSFaInvUgL 
 redirect_uri=https://www.mycustomerorderstatus.com/oauth2/callback& response_type=code

It requires the login & to click allow access then it redirects to my callback URL with accessCode. So I want to skip this process & auto-approve it because I am using it as background service & not interacting with user for login

How to auto approve Salesforce REST API OAuth2 authorization_code flow to not show allow pop-up.
Herish SurendranHerish Surendran
Try utilizing some of the steps mentioned in the link https://www.forcetalks.com/blog/salesforce-to-salesforce-integration-using-rest-api-callouts/ .
This might be a clue to your scenario. Or try to add custom domain url , username and password to the url https://login.salesforce.com/services/oauth2/authorize?
 client_id=3MVG9IHf89I1t8hrvswazsWedXWY0i1qK20PSFaInvUgL 
 redirect_uri=https://www.mycustomerorderstatus.com/oauth2/callback& response_type=code. If this solves your question. Mark this as solved.
Rohit Jadhav 12Rohit Jadhav 12
Thanks! for the reply. I am unable to understand it. It looks like you are also using the username & password approach.