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
neao18neao18 

Rest UserName/Password authentication not working!

I am trying to get aouth token from using the username and password authentication for Salesforce rest api.

I am using this url: https://login.salesforce.com/services/oauth2/token

I am using this Header:

grant_type: password
content-type: application/x-www-form-urlencoded
client_id: 3MVG9Y6d_Btp4xp7vvFtoM5KvlxGGeHkTNHMBRocXHDKgrY.**********************
client_secret: 77228**********
username: ******@****.com
password: ********ESbfkvMHuULtcEROf6CNiMRZ
I am also giving the accesstoken in the password. but I am always getting this:

error_description: "grant type not supported"
error: "unsupported_grant_type"
sfdcfoxsfdcfox
grant_type, client_id, client_secret, username, and password must be sent as the body of the HTTP request, not as headers.