[SalesForce] OAuth callback url

I have 2 different users in force.com i.e user1 and user2. I have developed a rest resource in user1. IF user2 logs in by using a connected app after OAuth authentication, I want to access the rest resource developed in user1 by providing the username,password,clientID,client secret etc.

Is this scenario feasible if so what shud be the callback urL? Here is where I am stuck?

Thanks
krishna Casukhela

Best Answer

What i have understood from your question is you are using Username and Password flow to get accesstoken aka SessionID. In this flow one does not need a callback URL. You can check it here https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_username_password_oauth_flow.htm

But when you create a Connected app, it asks you provide callback URL(which is used by other 2 Flows of Oauth namely Webserver flow and UserAgent flow) which is not needed by you at the moment. So you can provide dummy value like "https://www.google.com" or any URL starting with HTTPs.