Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 10 17:28
    github-actions[bot] commented #262
  • Aug 10 17:25

    depfu[bot] on update

    (compare)

  • Aug 10 17:25
    depfu[bot] closed #260
  • Aug 10 17:25
    depfu[bot] commented #260
  • Aug 10 17:25
    depfu[bot] assigned #262
  • Aug 10 17:25
    depfu[bot] labeled #262
  • Aug 10 17:25
    depfu[bot] opened #262
  • Aug 10 16:23

    depfu[bot] on update

    ⬆️ Update webmock to version 3.… (compare)

  • Aug 08 04:30
    codecov-commenter commented #261
  • Aug 08 04:26

    dependabot[bot] on bundler

    (compare)

  • Aug 08 04:26
    dependabot[bot] closed #258
  • Aug 08 04:26
    dependabot[bot] commented #258
  • Aug 08 04:26
    dependabot[bot] labeled #261
  • Aug 08 04:26

    dependabot[bot] on bundler

    Update webmock requirement from… (compare)

  • Aug 08 04:26
    dependabot[bot] opened #261
  • Aug 06 18:23
    codecov-commenter commented #260
  • Aug 06 18:23
    github-actions[bot] commented #260
  • Aug 06 18:20

    depfu[bot] on update

    (compare)

  • Aug 06 18:20
    depfu[bot] closed #259
  • Aug 06 18:20
    depfu[bot] commented #259
Gerard
@grdmorera_twitter

Hello, not sure if it is the right channel bu I have a question regarding exchanging request token to an access token:

    consumer = OAuth::Consumer.new(
      '64108c66-bb6a-4e81-a9e8-4816e815a03e',
      'xxxx',
      {
        site: 'https://connect.garmin.com',
        access_token_path: '/oauth-service/oauth/access_token'
      }
    )
    request_token = OAuth::RequestToken.new(
      consumer,
      '51cf7b7c-3245-4ebd-9065-35c5a50e16f2',
      'xxx'
    )
    request_token.get_access_token({
      oauth_verifier: 'lp09yk3h2I'
    })

RESULT:
OAuth::Unauthorized: 404 Not Found
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/oauth-0.5.10/lib/oauth/consumer.rb:257:in `token_request'

Any idea why I have this error?

Peter Boling
@pboling
404 Not Found is coming from the server you are making the request to, and is an indication that the URL is incorrect.
@grdmorera_twitter Does the service you are trying to connect with have api documentation?
Gerard
@grdmorera_twitter
You are right @pboling, thanks, URL was wrong
NOw it returns an AccessToken
[46] pry(#<GarminClient>)> a
=> #<OAuth::AccessToken:0x000002130eb82b80
 @consumer=
  #<OAuth::Consumer:0x000002130e9ea0e8
   @debug_output=nil,
   @http=#<Net::HTTP connectapi.garmin.com:443 open=false>,
   @http_method=:post,
   @key="64108c66-bb6a-4e81-a9e8-4816e815a03e",
   @options=
    {:signature_method=>"HMAC-SHA1",
     :request_token_path=>"/oauth/request_token",
     :authenticate_path=>"/oauth/authenticate",
     :authorize_path=>"/oauth/authorize",
     :access_token_path=>"/oauth-service/oauth/access_token",
     :proxy=>nil,
     :scheme=>:header,
     :http_method=>:post,
     :debug_output=>nil,
     :oauth_version=>"1.0",
     :site=>"https://connectapi.garmin.com"},
   @secret="xxxx">,
 @params=
  {:oauth_token=>"24ec370a-872c-4a40-9e57-9ed8a648d2fb",
   "oauth_token"=>"24ec370a-872c-4a40-9e57-9ed8a648d2fb",
   :oauth_token_secret=>"xxx",
   "oauth_token_secret"=>"xxx"},
 @secret="xxx",
 @token="24ec370a-872c-4a40-9e57-9ed8a648d2fb">
`
But not sure how to get from this object the token and the secret
Gerard
@grdmorera_twitter
Oh, it responds to .token . secret. Seems fine
sorry for the noice.
People like you makes the world run. Thanks <3
Peter Boling
@pboling
@grdmorera_twitter Great! :) glad to help