Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Justin Greer

    (@justingreerbbi)

    Hi,

    What does your request look like? Are you using the example word for word?

    Thread Starter xyzones

    (@xyzones)

    Hi,

    <server>/oauth/token/ in post with

    
    'grant_type': 'authorization_code',
    'code': request.args.get('code'),
    'redirect_uri':'<redirect_uri>',
    

    and the auth headers contains the cliend id and secret.

    I have the correct and expected answer with the access_token, expires_in, scope, token_type.

    Using this token with
    <server>/oauth/me?access_token=<my_token>

    results in the error above.

    Thread Starter xyzones

    (@xyzones)

    Hi, any updates please?

    Plugin Author Justin Greer

    (@justingreerbbi)

    I am unable to tell what your request looks like even if you are using the snippet provided in the article. Each server environment is different.

    If you used something like POSTMAN, perhaps I could help a bit more. See our article https://wp-oauth.com/documentation/how-tos/using-postman-wp-rest-api/ for more informationon using POSTAMN.

    POSTMAN will allow you and anyone supporting you to see what your request is in more detail and a copy and paste code.

    Please look into the link above and update me on what you request looks like while getting the error you are receiving.

    Thread Starter xyzones

    (@xyzones)

    <server>/oauth/me?access_token=<my_token>always results in error.

    • This reply was modified 8 years, 9 months ago by xyzones.
    Plugin Author Justin Greer

    (@justingreerbbi)

    Believe it or not this a good thing for support. Could you provide the request headers that POSTMAN is sending?

    Please omit sensitive data

    Thread Starter xyzones

    (@xyzones)

    request:

    GET <server>/oauth/me/?access_token=<token> HTTP/1.1
    Authorization: Basic <hash>
    Host: <server>

    response headers

    HTTP/1.1 400 Bad Request
    Server: nginx/1.9.10
    Date: Wed, 13 Sep 2017 14:59:44 GMT
    Content-Type: application/json
    Transfer-Encoding: chunked
    Connection: close
    X-Powered-By: PHP/7.0.19-1
    Link: <http://<server>/wp-json/>; rel="https://api.w.org/"
    Cache-Control: no-store

    response body:
    {"error":"invalid_request","error_description":"Missing or invalid parameter(s)"}

    Plugin Author Justin Greer

    (@justingreerbbi)

    Please remove your basic authorization header and try again.

    Thread Starter xyzones

    (@xyzones)

    same

    Plugin Author Justin Greer

    (@justingreerbbi)

    Ok. Something else is haywire.

    Please disable all plugins and enable the 2017 theme. The key here is “All” plugins. This is important. Once all plugins are deactivated, please enabled WP OAuth Server. Once the plugin is activated, please try your request again.

    If it is working, start enabling 1 plugin at a time and testing until the issue comes back.

    Please let me know the results.

    Thread Starter xyzones

    (@xyzones)

    still the same

    {“error”:”invalid_request”,”error_description”:”Missing or invalid parameter(s)”}

    Thread Starter xyzones

    (@xyzones)

    have a look on slack when you can

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘wp oauth + sso’ is closed to new replies.