Skip to content
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

UserPassword grant type issue #352

Open
tdigby opened this issue Sep 2, 2024 · 3 comments
Open

UserPassword grant type issue #352

tdigby opened this issue Sep 2, 2024 · 3 comments
Labels

Comments

@tdigby
Copy link

tdigby commented Sep 2, 2024

Hello,

I'm attempting to use the UserPassword method to authenticate with Salesforce and keep getting the following response from Salesforce:

`400 Bad Request` response: {"error":"unsupported_grant_type","error_description":"grant type not supported"}

I've tried connecting with and without the consumer key and secret credentials and that doesn't make a difference.

I assume something isn't set up correctly in Salesforce but I'm not sure what or where that would be.

Could you point me in the right direction?

@omniphx
Copy link
Owner

omniphx commented Sep 2, 2024

You do need the consumer key and secret. Did you try appending your security token to your password? Sometimes that is required if your IP is not whitelisted

@tdigby
Copy link
Author

tdigby commented Sep 3, 2024

I did manage to connect eventually via the client_credentials grant type. Salesforce appears to recommend this over the password grant type, so we'll probably stick with that.

I haven't tried adding the security token to the password but I'll give that a go and let you know whether it resolves the issue, in case others experience the same problem in future.

I also read numerous suggestions from Salesforce documentation and Stack Overflow posts that there is an option in Salesforce somewhere to enable the username-password flow but I haven't been able to track that down in the version of Salesforce we're using.

@omniphx omniphx added the useful label Sep 13, 2024
@omniphx
Copy link
Owner

omniphx commented Sep 13, 2024

One thing I've found helpful is to checking the login history for the user you are trying to authenticate. This might give you a clue about why you are getting this error. It's been while since I've done Salesforce work but from what I remember unsupported_grant_type is a generic error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants