Create Connected App : Connected App Name : Connected API Name : Email Id : Then Click on Enable OAuth Settings checkbox : Callback URL : Like https://<orgdomanName>.my.salesforce.com https://dns000000u40v2aa-dev-ed.develop.my.salesforce.com Select OAuth Scope : Full Access and click on Save button after that need to get Consumer ke and secret : click on manage consumer details button for consumer key and consumer secret Security Token Get : Click on view Profile Option then go to settings options Quick Find : Reset My Security Token and click on button and check your email for Security token Important : got to setup and search OAuth and OpenID Connect Settings and enable 1) Allow OAuth Username-Password Flows 2) Allow Authorization Code and Credentials Flows Required Information : Access Token URL : https://login.salesforce.com/services/oauth2/token Client ID : Client Secret : Username : Password : password<securityToken> Go to Code