• Hi,
    When I use this help:
    https://wp-oauth.com/documentation/grant-types/user-credentials/

    inside the program I’m making, it gives the correct response including token.

    But I need to use variables to get dynamic user input values, here is when the error is shown:
    {"error":"invalid_grant","error_description":"Invalid username and password combination"}

    This is the code I use inside programming interface:
    grant_type=password&username=#username&password=#password&client_id=#client_id&client_secret=#client_secret

    Using output to show the result of the command, it correctly shows the values.

    Even in POSTMAN with static parameters, the command works, but POSTMAN doesn’t work with dynamic values and variables.

    Any clue why this happens?
    Thanks a lot.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter msitman

    (@msitman)

    I’m not sure if I can call this a bug or not.

    When I use non-alphanumeric characters in the password, it throws that error, when I use just letters and numbers it works like a charm.

    How do I overcome this? I can’t tell the user to use a specific password schema.

    Plugin Author Justin Greer

    (@justingreerbbi)

    Thanks for the update. Unfortunately, I do not have an answer right now for this but I do have a possible idea.

    Are you submitting the information in the body or the URL? If you are not using a form post to submit the call (body request), I can see the request failing due to special characters.

    Thread Starter msitman

    (@msitman)

    This is the UI of the code I wrote, would you please check:
    https://pasteboard.co/H3YalBQ.png

    Parameters section is supposed to be the body.
    …………………………………………..
    P.S: Now it’s driving me nuts!

    Just double checked and saw the error appear again using special chars. changed the pass again (including special chars), this time it worked! So I can’t rely on this.

    But let’s refer to the image, am I using the request correctly?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Invalid username and password combination’ is closed to new replies.