You need to sign in to do that
Don't have an account?
Rollsroyc3
HTTP 400 error on POST request getting token authentication
I am trying to authenticate my remote access app, I can successfully get the code in the first step but when I send the second post to https://login.salesforce.com/services/oauth2/token I get a 400 Bad Request. Here is the .net code I am using, anyone have any ideas why this might not be working?
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load 'If Request.QueryString("code") Then Dim strCode = Request.QueryString("code") Dim strToken = getToken(strCode) ltlText.Text = strToken 'Else 'End If End Sub Private Function getToken(code As String) As String Dim URI As String = "https://login.salesforce.com/services/oauth2/token" Dim body As StringBuilder = New StringBuilder() body.Append("code=" & HttpUtility.UrlPathEncode(code) & "&") body.Append("grant_type=authorization_code&") body.Append("client_id=" & HttpUtility.UrlPathEncode(clientKey) & "&") body.Append("client_secret=" & HttpUtility.UrlPathEncode(clientSecret) & "&") body.Append("redirect_uri=" & HttpUtility.UrlPathEncode(redirectURL)) Dim result As String = HttpPost(URI, body.ToString()) Return result End Function
You need to supply username and password as well and change grant type to password.
Since buthfa seems to be on the same page as you, I am not sure if I am out of place here
=============================
Developer for www.voicent.com
Voicent provides CRM, auto dialer, predictive dialer, reminder, and call center solution that is suitable for anyone in any level
Voicent strives to meet customer demands to integrate Voicent software with CRM of their choice.