Support » Plugin: WP OAuth Server (OAuth Authentication) » The grant type was not specified in the request

  • rauljr7

    (@rauljr7)


    Hello! I was able to successfully create an auth code and I’m sending a POST request via PHP Curl to create an Access Token and I keep getting “The grant type was not specified in the request” and it’s via HTTPS and I echoed out the full URL and sure enough I am passing the grant_type and code and even my client id and secret as well as the basic header auth with the base64 client and secret. Only other thing to note, which I’m not sure if it really is an issue but I’m doing a XHR call on my client on SiteA.com pointing to SiteB.com/getAccessToken.php which has the curl code that calls SiteA.com

    I was having some PHP Curl issues calling to my own server and it was taking me long while to figure out so in an effort to at the very least do a work-around and fix that later I ping-ponged the request to another server, it’s a live site, that will return the curl response and that resolved my CURL error but now I’m getting that grant_type not specified error

Viewing 6 replies - 1 through 6 (of 6 total)
  • I even tried grant_type = password and that one also says no grant type was passed

    Plugin Author Justin Greer

    (@justingreerbbi)

    Forum Moderator

    Hi @rauljr7

    Sorry for the issues. First things first. make sure you are using the latest version of the plugin. We did apply a patch recently for a small issue that involved request issues. It was rare but it was patched.

    If you are using the community version, the only grant type supported is authorization code. All other grant types will fail as the library is not included.

    When you send these requests, are you sending the variables in the body?

    Yes I updated very recently. Yeah I know I just tried the password to see if it would at the very least give me some sort of error for trying to use the “password” type while in the community version but still same error. Yes I am sending only 2 variables in the body, the “code” variable with the auth code that generates for me just fine and then the “grant_type” variable which is always “authorization_code” and in the params I’m doing oauth=token (the permalink thing never worked for me so I just add the param manually, that’s how I got the auth code to generate) and doing basic header auth with client and secret

    I am able to send you a message in private? Or email or something? I can send you the link so you can see for yourself, I just don’t wanna publish it in public

    Plugin Author Justin Greer

    (@justingreerbbi)

    Forum Moderator

    @rauljr7 Unfortunately, we can not use these forums to send links, etc. Please visit https://wp-oauth.com.

    Okay I used your LiveChat feature to send a message so you can see what I’m talking about. I titled it “grant type issue on forum”, hope you get it soon, thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘The grant type was not specified in the request’ is closed to new replies.