{"id":20347491,"url":"https://github.com/evilmartians/omniauth-ebay-oauth","last_synced_at":"2025-04-12T00:56:07.557Z","repository":{"id":56886397,"uuid":"108110427","full_name":"evilmartians/omniauth-ebay-oauth","owner":"evilmartians","description":"OmniAuth Strategy for eBay Apps (for using with eBay REST APIs)","archived":false,"fork":false,"pushed_at":"2024-06-19T13:38:18.000Z","size":68,"stargazers_count":7,"open_issues_count":1,"forks_count":6,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-12T00:55:59.245Z","etag":null,"topics":["ebay","ebay-api","oauth","omniauth-strategy","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evilmartians.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-24T10:15:34.000Z","updated_at":"2024-06-19T13:38:22.000Z","dependencies_parsed_at":"2022-08-20T14:31:14.691Z","dependency_job_id":null,"html_url":"https://github.com/evilmartians/omniauth-ebay-oauth","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilmartians%2Fomniauth-ebay-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilmartians%2Fomniauth-ebay-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilmartians%2Fomniauth-ebay-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilmartians%2Fomniauth-ebay-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evilmartians","download_url":"https://codeload.github.com/evilmartians/omniauth-ebay-oauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501879,"owners_count":21114683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ebay","ebay-api","oauth","omniauth-strategy","ruby"],"created_at":"2024-11-14T22:16:55.106Z","updated_at":"2025-04-12T00:56:07.529Z","avatar_url":"https://github.com/evilmartians.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/omniauth-ebay-oauth.svg)](https://badge.fury.io/rb/omniauth-ebay-oauth)\n[![Tests Status](https://github.com/evilmartians/omniauth-ebay-oauth/actions/workflows/test.yml/badge.svg)](https://github.com/evilmartians/omniauth-ebay-oauth/actions)\n[![Cult of Martians](http://cultofmartians.com/assets/badges/badge.svg)](http://cultofmartians.com/tasks/ebay-oauth-signin.html)\n\n# omniauth-ebay-oauth\n\nOmniAuth Strategy for eBay Apps (for using with eBay REST APIs)\n\n\u003ca href=\"https://evilmartians.com/?utm_source=omniauth-ebay-oauth\u0026utm_campaign=project_page\"\u003e\n\u003cimg src=\"https://evilmartians.com/badges/sponsored-by-evil-martians.svg\" alt=\"Sponsored by Evil Martians\" width=\"236\" height=\"54\"\u003e\n\u003c/a\u003e\n\n## Preface\n\n\u003e Why do I need it? There are a couple of other gems with OmniAuth strategies for eBay?\n\neBay has two different authorization methods: Auth'n'auth and OAuth. Technically, they are both uses OAuth2 protocol (just to embrace a little confusion).\n\nThis gem implements authorization with OAuth method while currently available gems (like [ebay_request](https://github.com/gzigzigzeo/ebay_request) or [omniauth-ebay](https://github.com/TheGiftsProject/omniauth-ebay)) implements Auth'n'auth.\n\n__What is the difference? Access tokens!__\n\nWith Auth'n'auth you will get a single token which you can use to access only old eBay XML APIs (Trading API, etc.)\n\nWith OAuth, you will get a pair of access and refresh tokens which can be used to access new eBay REST APIs (Buy API, Sell API, etc.)\n\nHowever, you can use new OAuth tokens to access old APIs too by providing an access token in HTTP header `X-EBAY-API-IAF-TOKEN`. This is documented in eBay developer program website: [Using OAuth with the eBay traditional APIs](https://developer.ebay.com/api-docs/static/oauth-trad-apis.html#Implemen).\n\nIf you plan to use new APIs, you are welcome to use this gem together with [ebay_api](https://github.com/nepalez/ebay_api) client gem for REST APIs.\n\nFor old APIs, you can look at [ebay_request](https://github.com/gzigzigzeo/ebay_request) gem (you can configure it to use OAuth tokens).\n\nNow you can read the eBay docs about [REST APIs](https://developer.ebay.com/api-docs/static/ebay-rest-landing.html) and [OAuth](https://developer.ebay.com/api-docs/static/oauth-quick-ref-user-tokens.html) and then proceed to…\n\n\n## Installation\n\nAdd to your Gemfile:\n\n```ruby\ngem 'omniauth-ebay-oauth'\n```\n\nThen execute:\n\n```sh\nbundle install\n```\n\n\n## Usage\n\n```ruby\nuse OmniAuth::Builder do\n  provider :ebay_oauth, CLIENT_ID, CLIENT_SECRET, callback_url: RU_NAME,\n    sandbox: false, scope: 'https://api.ebay.com/oauth/api_scope' # redefining additional default options\nend\n```\n\nRequired options:\n  - __CLIENT_ID__, __CLIENT_SECRET__ - Your application's [OAuth credentials](\u003chttps://developer.ebay.com/api-docs/static/oauth-credentials.html\u003e) for the environment you're targeting.\n  - __callback_url__  - Your application's [RuName](\u003chttps://developer.ebay.com/api-docs/static/oauth-runame.html\u003e) for the environment you're targeting.\n\nAdditional options:\n  - __sandbox__ - Are you running your application in [sandbox mode](\u003chttps://developer.ebay.com/api-docs/static/sandbox-landing.html\u003e), default __`true`__.\n  - __scope__ - A list of [OAuth scopes](\u003chttps://developer.ebay.com/api-docs/static/oauth-details.html#scopes\u003e) that provide access to the interfaces you call, default: __`[]`__. If you want change scopes you could pass it as string or as array of scopes like so: `['https://api.ebay.com/oauth/api_scope/sell.marketing.readonly', 'https://api.ebay.com/oauth/api_scope/sell.account.readonly']`\n  - __prompt__ - Use value `login` to ask user for login and password even if they're already logged in (useful for switching between multiple accounts). By default is absent.\n  - __read_timeout__ - Number of seconds to wait for one block to be read for Auth'n'auth eBay API requests, default is 60.\n  - \\+ all [OmniAuth](\u003chttps://github.com/omniauth/omniauth\u003e) supported options, like: `callback_path`, `provider_ignores_state` and so on.\n\nAdditional usage information could be found on [OmniAuth README page](\u003chttps://github.com/omniauth/omniauth#integrating-omniauth-into-your-application\u003e).\n\n\n## Minimal working Sinatra application:\n\n```ruby\nrequire 'sinatra'\nrequire 'omniauth-ebay-oauth'\n\nuse Rack::Session::Cookie\nuse OmniAuth::Builder do\n  provider :ebay_oauth, ENV['EBAY_CLIENT_ID'], ENV['EBAY_CLIENT_SECRET'],\n    callback_url: ENV['EBAY_RU_NAME'], name: 'ebay'\nend\n\nget '/' do\n  redirect '/auth/ebay'\nend\n\nget '/auth/ebay/callback' do\n  \"Hello, #{request.env['omniauth.auth'].dig('info', 'name')}\"\nend\n\n# OmniAuth disables starting authentication with GET request to mitigate CVE-2015-9284.\n# For testing purposes we can enable it, but for production it is better to use POST with CSRF protection/\nOmniAuth.config.allowed_request_methods += %i[get]\n```\n\n\n## Development\n\nTo pass your code through the all checks you simply need to run:\n\n```\nbundle exec rake\n```\n\nPlease, keep in mind [OmniAuth Strategy Contribution Guide](\u003chttps://github.com/omniauth/omniauth/wiki/Strategy-Contribution-Guide\u003e) and [eBay developers program](\u003chttps://developer.ebay.com/api-docs/static/oauth-tokens.html\u003e).\n\n### Releasing new versions\n\n1. Bump version number in `lib/omniauth/ebay-oauth/version.rb`\n\n   In case of pre-releases keep in mind [rubygems/rubygems#3086](https://github.com/rubygems/rubygems/issues/3086) and check version with command like `Gem::Version.new(OmniAuth::EbayOauth::VERSION).to_s`\n\n2. Fill `CHANGELOG.md` with missing changes, add header with version and date.\n\n3. Make a commit:\n\n   ```sh\n   git add lib/omniauth/ebay-oauth/version.rb CHANGELOG.md\n   version=$(ruby -r ./lib/omniauth/ebay-oauth/version.rb -e \"puts Gem::Version.new(OmniAuth::EbayOauth::VERSION)\")\n   git commit --message=\"${version}: \" --edit\n   ```\n\n4. Create annotated tag:\n\n   ```sh\n   git tag v${version} --annotate --message=\"${version}: \" --edit --sign\n   ```\n\n5. Fill version name into subject line and (optionally) some description (list of changes will be taken from `CHANGELOG.md` and appended automatically)\n\n6. Push it:\n\n   ```sh\n   git push --follow-tags\n   ```\n\n7. GitHub Actions will create a new release, build and push gem into [rubygems.org](https://rubygems.org)! You're done!\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/evilmartians/omniauth-ebay-oauth.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilmartians%2Fomniauth-ebay-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilmartians%2Fomniauth-ebay-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilmartians%2Fomniauth-ebay-oauth/lists"}