+ Start a Discussion
statforcestatforce 

username/Password authentication, {"error":"unknown_error","error_description":"retry your request"}

I registered for a developer edition account to use the REST API for a project. I am not able to get the authentication done.

I get  

{"error":"unknown_error","error_description":"retry your request"}

message. This happens only for the developer account. I tried the same authentication method on a professional (trial) and a group edition with success.

 

 Below is the command i use. I made sure i am using the correct client_id/client_secret/password+securityToken

 

curl https://login.salesforce.com//services/oauth2/token -d "grant_type=password&client_id={client_id}&client_secret={secret}&username={uname@email.com}&password={password+SecurityToken}"

edanpedanp

I was having the same issue and couldn't find any answer for it.

 

I'm a newbie in salesforce so thought i'm missing something in the setup. Changed lots of parameters in my account but nothing helped.

 

Finally, tried to submit the request to ap1.salesforce.com (which is the domain I see after I login) and I got the correct response.

 

curl -v 'https://ap1.salesforce.com/services/oauth2/token' -d 'grant_type=password' -d 'client_id=[consumer_key]' -d 'client_secret=[consumer_secret]' -d 'username=[userrname]' -d 'password=[password+token]'

Hope this is the only change needed and not one of the million other settings I played with

StevenWillStevenWill

@ednap: Your post helped me a great deal. When I logged into the salesforce.com through the browser I was sent to the domain ns14.salesforce.com and I used that domain with my curl request and received the authenticated json response. I wonder if this issue has something to do with the connected app being in the pending state and the updates not being reflected across all the domains.

Oleh UdovytskyiOleh Udovytskyi
@edanp, StevenWill:  Thanks guys, I've also succeed after I have tried to login using the domain name I see in browser after login.