OAuth authentication Implementation Problems

Discussion in 'Shapeways API' started by 824792_deleted, May 27, 2015.

  1. Hi at first i am new to PHP ,, I have website with 3dmodels and i want to implement your API to make users order printed model by you..
    So I have consumer_key and consumer_secret and i have installed Oauth extention and verified that it been installed ..
    Now i am kindda stucked because i am trying to start implementing OAuth authentication on a test.php page to check if it's working (from this page https://developers.shapeways.com/getting-started) .. this is my code maybe i am missing something or i don't get what i supose to do...the page getting stucked/crashing in Oauth class creation and it not getting to the echo check stage 1..

    thanks, and best regards

    Code:
    
    <?php
    /*
    * Template Name: TEST
    */
    ?>
    <?php
    get_header(); 
    ?>
    	<div id="main_content" class="<?php echo $_main_class?>">
    							<h1>Test Page</h1>
    <?php  
    									$consumer_key = "hereismyconsumer_key";
    									 $consumer_secret = "hereismyconsumer_secret";
    
     $oauth_client = new Oauth(
            $consumer_key,
            $consumer_secret,
            OAUTH_SIG_METHOD_HMACSHA1,
            OAUTH_AUTH_TYPE_AUTHORIZATION
          );
    echo 'echo check stage 1..<br>';
    
          $info = $oauth_client->getRequestToken(
            "$api_url_base/oauth1/request_token/v1",
            "oob"
          );
        echo 'echo check stage 2..<br>';
    ?>
    </div>
    <?php get_footer(); ?>
    
     
    Last edited: May 27, 2015