New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getting HTTP400 error using oauth2 #20
Comments
You're going to have to provide a bit more info. |
Hi Jesper, Here’s the error I’m getting when I use the ForceApi. It works fine using curl or wiztool.org http://wiztool.org/ rest client. Thanks for your help. curl https://login.salesforce.com/services/oauth2/token -d 'grant_type=password&client_id=3MVG9A2kN3Bn17hv8siDyJtftcr88aXG3TpBJIqO8QZac_dpXPEoQy08vgi651aB8y6QdfgCkW0HsDIyQeH1V&client_secret=4631320832041516337&username=jigsheth@sfdc.com&password=' -H "X-PrettyPrint: 1" {
Bad response code: 400 on request: grant_type=password&client_id=3MVG9A2kN3Bn17hv8siDyJtftcr88aXG3TpBJIqO8QZac_dXPEoQy08vgi651aB8y6QdfgCkW0HsDIyQeH1V&client_secret=4631320832041516337&username=jigsheth%40sfdc.com&password= 2015-04-23 06:28:27.445 ERROR 37528 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: java.io.EOFException: No content to map to Object due to end of input] with root cause java.io.EOFException: No content to map to Object due to end of input Best Regards, Platform as a Service | Agile Development | Big Data
|
I am having the same problem. Diving into this after not having touched this repo in a looong time. I can't even get a successful curl authentication to work right now. Not sure what I am doing wrong:
|
don’t url encode the data .. (userid, password, client_id or client_secret). I see your userid is encoded. just use .. jesper@forcerestapi.dev Best Regards, Platform as a Service | Agile Development | Big Data
|
Ok. I finally got curl working. Not sure what I did wrong. Created new OAuth clients and reset security token. It works whether @ is url encoded or not btw. |
I fixed some issues in 2805b42 and most tests are passing now. The code now uses "Bearer" in the authorization header. I suspect this might have been the issue, but I am not sure. I also added a missing Accept header. Let me know if you're able to test it and see if it fixes your issue. |
Fix is now included in 0.0.21 |
Hi Jesper, I’m still having issue. I'm still getting 400 error … Bad response code: 400 on request: grant_type=password&client_id=3MVG9A2kN3Bn17hv8siDyJtftcr88aXG3TpBJIqO8QZac_dXPEoQy08vgi651aB8y6QdfgCkW0HsDIyQeH1V&client_secret=4631320832041516337&username=jigsheth%40sfdc.com&password=Test1234dDumeVuL111zfI0AGwfL1QG4 2015-04-25 19:26:23.093 ERROR 52860 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: java.io.EOFException: No content to map to Object due to end of input] with root cause java.io.EOFException: No content to map to Object due to end of input I’m basically trying to get list of Accounts and associated Contacts & Opportunities. I can access it using Wiztool.org http://wiztool.org/ REST Client, but not having luck with your force-rest-api or using Apache HTTP Client. Any help would be greatly appreciated. Thanks. Best Regards, Platform as a Service | Agile Development | Big Data
|
Hi Jasper, It was user error. My client id had character missing. It works and get the token. However, I’m still having issue with deserializing. Does the POJO have to exact as the SFDC Account object? I have following annotation "@JsonIgnoreProperties(ignoreUnknown = true)”, but still get error. Any Idea?? 2015-04-25 19:43:24.341 ERROR 52931 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.force.api.ResourceException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "Id" (Class io.pivotal.example.sfdc.Account), not marked as ignorable org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "Id" (Class io.pivotal.example.sfdc.Account), not marked as ignorable Best Regards, Platform as a Service | Agile Development | Big Data
|
How does your class compare to the Account class in the test suite? |
Thanks for all your help. I was using wrong import class for JsonIgnoreProperties. Thanks,
|
Bad response code: 400 on request:
POST https://login.salesforce.com/services/oauth2/token
The text was updated successfully, but these errors were encountered: