Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"error":"invalid_grant","error_description":"authentication failure"}
- local.http = new Http(url='https://test.salesforce.com/services/oauth2/token',method='post');
- local.http.addParam(type='header',name='content-type', value='application/x-www-form-urlencoded');
- local.http.addParam(type='formField',name='grant_type', value='password');
- local.http.addParam(type='formField',name='client_id', value='client_id');
- local.http.addParam(type='formField',name='client_secret', value='client_password_string');
- local.http.addParam(type='formField',name='username', value='user@email.com');
- local.http.addParam(type='formField',name='password', value='userspassword');
- local.http.addParam(type='formField',name='format', value='json');
- local.httpSendResult = local.http.send();
- rc.httpResult = httpSendResult.getPrefix();
- <cfhttp url="https://test.salesforce.com/services/oauth2/token" method="POST">
- <cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" />
- <cfhttpparam type="formField" name="grant_type" value="password" />
- <cfhttpparam type="formField" name="client_id" value="client_id" />
- <cfhttpparam type="formField" name="client_secret" value="client_password_string" />
- <cfhttpparam type="formField" name="username" value="user@email.com" />
- <cfhttpparam type="formField" name="password" value="userspassword" />
- </cfhttp>
- <cfset rc.result = cfhttp.fileContent />
- curl -d "grant_type=password"
- -d "client_id=client_id"
- -d "client_secret=client_secret_string"
- -d "username=user@email.com.dev"
- -d "password=userpassword" https://test.salesforce.com/services/oauth2/token
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement