forrest icon indicating copy to clipboard operation
forrest copied to clipboard

Invalid grant_type and authentication failed

Open arjunnarale opened this issue 5 years ago • 2 comments

            Config::set('forrest.authentication', 'UserPassword');
            Config::set('forrest.credentials.consumerKey', $salesforceDetails->consumer_key);
            Config::set('forrest.credentials.consumerSecret', $salesforceDetails->consumer_secret);
            Config::set('forrest.credentials.callbackURI', $salesforceDetails->callback_url);
            Config::set('forrest.credentials.loginURL', $salesforceDetails->login_url);
            Config::set('forrest.credentials.username', $salesforceDetails->username);
            Config::set('forrest.credentials.password', $salesforceDetails->password);
            Config::set('forrest.credentials.grant_type', 'authorization_code');

I am already set the required parameter and set grant_type as authorization_code, Its throws error invalid grant_type. I have used another way using the Password instead of authorization_code. It throws 400 bad requests. Please advise as early as possible.

arjunnarale avatar Aug 18 '20 05:08 arjunnarale

When you configured your password did you append the security token to the end? If Login IP ranges are configured and you are in an acceptable range, you don't need the security token but you could also be getting this error due to IP ranges. You can check the user's login history and see more details there inside your salesforce org.

omniphx avatar Oct 15 '20 20:10 omniphx

Try setting the IP setting to 'relaxed'

krlmrr avatar Feb 17 '22 17:02 krlmrr