• Resolved zaszombie

    (@zaszombie)


    Hello,

    i want to use the oauth2 to make posts with my Java application.

    But i’m struggling at the last point described here:
    Access Token Request
    https://wp-oauth.com/kb/using-authorization-code/

    I get the code but when i try to make the “final” request, i only get the following error:
    {“error”:”invalid_client”,”error_description”:”No client id supplied”}

    But I set it:
    post.setHeader(“Authorization”, “Basic ” + Base64Encode(clientId+”:”+secret));

    The Post params are:
    nameValuePairs.add(new BasicNameValuePair(“grant_type”, “authorization_code”));
    nameValuePairs.add(new BasicNameValuePair(“code”, code));

    Did I miss sth?

    I appreciate any help, thanks in advance

    Don’t mind, I had an error in the URL

    • This topic was modified 9 years, 4 months ago by zaszombie.
    • This topic was modified 9 years, 4 months ago by zaszombie.
Viewing 1 replies (of 1 total)
  • Plugin Author Justin Greer

    (@justingreerbbi)

    Hi,

    This is common if you are using PHP with CGI. If this is the case, any authorization headers will not be read by the server. This is a limitation with CGI and PHP. To combat this try passing two more parameters with the body request.

    
    nameValuePairs.add(new BasicNameValuePair(“client_id”, “your client id”));
    nameValuePairs.add(new BasicNameValuePair(“client_secret”, “your client secret”));
    
Viewing 1 replies (of 1 total)

The topic ‘Error: invalid client – no client id supplied’ is closed to new replies.