Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8913585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:29:59+00:00 2026-06-15T04:29:59+00:00

I’m trying to integrate my ruby on rails app to magento, and I got

  • 0

I’m trying to integrate my ruby on rails app to magento, and I got so far as to make the initial request, get authorized, and I believe I’m getting the final token, but I can’t be sure. Here is what I have in my response:

(There’s a lot of stuff here, so skip ahead where I pluck out the import bits)

 .....
 "credentials"=>
  {"token"=>"r8apb2rcgci9ry5hugcuiqlnwdi0evc1",
   "secret"=>"8pnyogb4048toujt5rjoq26tqh50vkv5"},
 "extra"=>
  {"access_token"=>
    #<OAuth::AccessToken:0x007fdd59893468
     @consumer=
      #<OAuth::Consumer:0x007fdd5995f928
       @http=#<Net::HTTP mymagentocart.dev:443 open=false>,
       @http_method=:post,
       @key="ttuj6ok0ioziv7bcfwi8wprzqe6o4x1e",
       @options=
        {:signature_method=>"HMAC-SHA1",
         :request_token_path=>"/oauth/initiate",
         :authorize_path=>"/admin/oauth_authorize",
         :access_token_path=>"/oauth/token",
         :proxy=>nil,
         :scheme=>:header,
         :http_method=>:post,
         :oauth_version=>"1.0",
         :site=>"https://mymagentocart.dev"},
       @secret="b0maut2ftkg2wb3nm24t263720n7kxqa">,
     @params=
      {:oauth_token=>"r8apb2rcgci9ry5hugcuiqlnwdi0evc1",
       "oauth_token"=>"r8apb2rcgci9ry5hugcuiqlnwdi0evc1",
       :oauth_token_secret=>"8pnyogb4048toujt5rjoq26tqh50vkv5",
       "oauth_token_secret"=>"8pnyogb4048toujt5rjoq26tqh50vkv5"},
     @secret="8pnyogb4048toujt5rjoq26tqh50vkv5",
     @token="r8apb2rcgci9ry5hugcuiqlnwdi0evc1">},
 "oauth_token"=>"jj2dbrea7dimxwc0twibyoikxjazvs6y",
 "oauth_verifier"=>"83idqmtmb76fe5axad1rf7lhfa3wqxki"
.....

I see in the access token, my key and secret:

@key="ttuj6ok0ioziv7bcfwi8wprzqe6o4x1e" 
@secret="b0maut2ftkg2wb3nm24t263720n7kxqa”

This is what magento gave me when I created a REST consumer in the admin.

Then there’s a bunch of repeated token and secrets, but they’re all the same and fall under the “credentials” label:

“token"=>"r8apb2rcgci9ry5hugcuiqlnwdi0evc1" 
“secret"=>"8pnyogb4048toujt5rjoq26tqh50vkv5”

And finally, there’s the oauth_token and oauth_verifier:

“oauth_token"=>"jj2dbrea7dimxwc0twibyoikxjazvs6y" 
“oauth_verifier"=>"83idqmtmb76fe5axad1rf7lhfa3wqxki”

So here’s my problem…

Which of these do I need to pass with future requests to authenticate straight away without needing to regenerate a token?

In my app currently, each time I make a request, it keeps sending me back to the user confirmation screen in magento to authorize.

Also, how can I make a request to get my magento user id, name, etc… so I can generate a user in rails app using this info?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:30:00+00:00Added an answer on June 15, 2026 at 4:30 am

    You have the access token object so you should be able to do something like this:

    auth_hash["extra"]["access_token"].get("/api/rest/products")
    

    If you want to create a new access token object you can do the following with the keys and tokens I pulled from your example:

    @consumer=OAuth::Consumer.new("ttuj6ok0ioziv7bcfwi8wprzqe6o4x1e", "b0maut2ftkg2wb3nm24t263720n7kxqa", {:site => "https://mymagentocart.dev"})
    @access_token = OAuth::AccessToken.new(@consumer, "r8apb2rcgci9ry5hugcuiqlnwdi0evc1", "8pnyogb4048toujt5rjoq26tqh50vkv5")
    @access_token.get("/api/rest/products")
    

    See “Using a long living Access Token” on this page: http://code.google.com/p/oauth-plugin/wiki/AccessToken

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Ruby Gem Databasedotcom to integrate Salesforce in a Rails app
I am trying to use regular expressions in a ruby on rails app to
I was trying to integrate twitter authentication into my Ruby on Rails application (from
Hi I'm trying to integrate MySpace with my Android app. As I'm new to
Hi I'm trying to integrate an LDAP search functionality into my app similar to
So I am somewhat new to Rails 3, and I am trying to integrate
I am trying to integrate spree into a fresh install of a rails application.
I'm trying to connect Rails to SQL Server. I installed the activerecord-sqlserver-adapter and ruby-odbc
I am currently trying to use the Grackle Ruby GEM to integrate with the
I've got a rails app with models which occur on a weekly basis. Put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.