Ruby Oauth Returning 401 Unauthorized

Discussion in 'Shapeways API' started by hunter8, Jul 6, 2017.

  1. hunter8
    hunter8 Member
    I'm attempting to make an app that pulls materials from Shapeways to show to users. I was planning on just using my account's access token to do this but I'm having trouble making this happen. Here is the code I have so far...

    site: "",
    request_token_path: "/oauth1/request_token/v1",
    access_token_path: "/oauth1/access_token/v1",
    signature_method: "HMAC-SHA1"

    @request_token = @consumer.get_request_token

    # Ruby's 'oauth' Gem Can't Seem To Read The Authentication URL Correctly So It Needs To Be Pulled This Way
    @auth_url = @request_token.params['authentication_url']

    binding.pry # This stops server execution using the 'pry' gem so I can visit the URL and finish the rest of the code in an IRB Console

    @request_token.get_access_token(oauth_verifier: "VERIFIER GIVEN TO ME VIA SHAPEWAYS") # This line returns "OAuth::Unauthorized: 401 Unauthorized"

    Any idea why this is happening?

  2. stonysmith
    stonysmith Well-Known Member Moderator