Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Authentication returns Invalid credentials #11

Closed
Sun3 opened this issue Oct 13, 2022 · 8 comments
Closed

Authentication returns Invalid credentials #11

Sun3 opened this issue Oct 13, 2022 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@Sun3
Copy link

Sun3 commented Oct 13, 2022

When you try to login via https://dummyjson.com/auth/# with username rshawe2 and password OWsTbMUgFc it returns the message: {"message":"Invalid credentials"}

I tried different username and passwords from https://dummyjson.com/users or from https://dummyjson.com/users?select=username,password with the same results.

Any ideas?
Thanks.

@Ovi Ovi added the help wanted Extra attention is needed label Oct 14, 2022
@Ovi
Copy link
Owner

Ovi commented Oct 14, 2022

Hey @Sun3,
I just tried with multiple credentials and they seem to be working fine.
Screenshot from 2022-10-14 15-53-57

However, if we remove the headers: { 'Content-Type': 'application/json' }, from request, we get invalid credentials, because the body is not sent to the server as json.
Screenshot from 2022-10-14 15-54-17

@Ovi Ovi closed this as completed Oct 14, 2022
@Sun3
Copy link
Author

Sun3 commented Oct 14, 2022

@Ovi Thank you, it's working.

@NjordJ
Copy link

NjordJ commented Nov 13, 2022

@Ovi
Is it still working? Because when checking through postman and when developing an android application, I get a 400 error. I pass the 'Content-Type': 'application/json' to the header.
Postman:
First image
Seconds image

App:
First image
Seconds image

@Ovi
Copy link
Owner

Ovi commented Nov 15, 2022

Hey @NjordJ, I can confirm that it's working fine.
Maybe you can share postman request here so we can try.

@NjordJ
Copy link

NjordJ commented Nov 15, 2022

@Ovi sharing postman collection with requests, checked another post request, it works fine, can't figure out what the problem is.

https://www.getpostman.com/collections/b55a025eb8e54300279c

@Ovi
Copy link
Owner

Ovi commented Nov 16, 2022

@NjordJ I see the issue.
Screenshot from 2022-11-16 14-19-29

You have selected form data in data type, when we select form data, the content-type header is replaced by Postman.
Please select "raw" and "JSON" to send your data. (See the image attached for reference)

Screenshot from 2022-11-16 14-21-04

@NjordJ
Copy link

NjordJ commented Nov 16, 2022

@Ovi Thanks for the help

@jerlam06
Copy link

I can confirm that there is an issue on postman, I am using RAW and JSON but still get Invalid Credentials.

This was referenced Jan 13, 2023
Ovi added a commit that referenced this issue Jan 20, 2023
Added support for multipart/form-data and parsing application/x-www-form-urlencoded

Related to #9, #11, #17 and #18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants