Verifier Invalid

Discussion in 'Shapeways API' started by Ynothna, Jan 8, 2018.

  1. Ynothna
    Ynothna Member

    I'm new to Shapeways API and not having a lot of luck getting it working.

    I have created an app, uploaded the files from to my web server, added in my consumer ID numbers and attempted to load the Authorize-oauth1-pecl.php page but have not been able to get father than that. I get the following error no matter what I try (I've tried on two different web servers, 3 browsers, 3 devices, and 2 locations).

    Error : stdClass Object
      [result] => failure
      [reason] => Authentication Error
      [oauth_error_message] => oauth_problem=verifier_invalid
      string(584) "HTTP/1.1 401 Unauthorized
    If anyone can point me in the right direction it would be hugely appreciated. I was only able to find three other posts on the forum to do with the issue and none of it seems to help.

    Thanks so much!
  2. hans_lambermont
    hans_lambermont Shapeways Employee Dev Team
    You mention "the Authorize-oauth1-pecl.php page", it's not a page, it's intended as a command-line program like all the other demo scripts in that repo.
    It uses the readline function to read in the pin that you are supposed to type which is not available in php for a web page, see .
    -- Hans
  3. Ynothna
    Ynothna Member
    Hi Hans,

    Thank you for getting back to me. I didn't think I should need to access that page directly, I misunderstood the documentation. The configuration details said:

    1. Get an oauth1 Consumer Key at and store the Consumer Key in consumer_key.php
    2. Run Authorize-oauth1-pecl.php to :
    • get temporary credentials (aka a Request Token)
    • authorize the Consumer Key with the Request Token via the presented URL to get the Verifier code
    • enter the Verifier code to request an Access Token
    • store the Access Token in access_token.php.
    So I thought #2 meant to run that page on it's own the first time to get the access token.

    When I try to open any of the sample pages I get the following error instead:

    A fatal error occurred during fetch exceptionin file on line <18> Exception : Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect) Error : stdClass Object ( [result] => failure [reason] => Authentication Error [oauth_error_message] => oauth_problem=token_rejected )