No release in over 3 years
An OmniAuth strategy for authenticating with Uber Eats using OAuth 2.0. Supports store provisioning via the eats.pos_provisioning scope.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 3.12
~> 1.75
~> 0.22
~> 3.18

Runtime

 Project Readme

OmniAuth Uber Eats OAuth2

Gem Version CI Coverage License: MIT

An OmniAuth strategy for authenticating with Uber Eats using OAuth 2.0.

Installation

Add this line to your application's Gemfile:

gem 'omniauth-uber-eats-oauth2'

And then execute:

bundle install

Or install it yourself as:

gem install omniauth-uber-eats-oauth2

Usage

Rails / Devise

In your Devise initializer (config/initializers/devise.rb):

config.omniauth :uber_eats_oauth2,
  ENV['UBER_EATS_CLIENT_ID'],
  ENV['UBER_EATS_CLIENT_SECRET']

Standalone (Rack)

use OmniAuth::Builder do
  provider :uber_eats_oauth2,
    ENV['UBER_EATS_CLIENT_ID'],
    ENV['UBER_EATS_CLIENT_SECRET']
end

Auth Hash Schema

After successful authentication, request.env['omniauth.auth'] will contain:

{
  provider: 'uber_eats_oauth2',
  uid: 'abc123',            # store_id from Uber Eats
  info: {
    name: 'Pizza Palace',   # store name
    business_name: 'Pizza Palace',
    email: nil               # Uber Eats does not expose merchant email
  },
  credentials: {
    token: 'ACCESS_TOKEN',
    refresh_token: 'REFRESH_TOKEN',
    expires_at: 1234567890,
    expires: true
  },
  extra: {
    raw_info: {
      store_id: 'abc123',
      store_name: 'Pizza Palace',
      id: 'abc123',
      status: 'ACTIVE'
    }
  }
}

Configuration Options

Option Default Description
sandbox false Reserved for future sandbox environment support

Callback URL

Uber Eats requires an exact redirect URI match. The strategy automatically strips query parameters from the callback URL before token exchange.

Register your callback URL in the Uber Developer Dashboard:

https://yourdomain.com/auth/uber_eats_oauth2/callback

Token Refresh

Uber Eats access tokens are valid for 30 days (2,592,000 seconds). To refresh:

client = OAuth2::Client.new(
  ENV['UBER_EATS_CLIENT_ID'],
  ENV['UBER_EATS_CLIENT_SECRET'],
  site: 'https://api.uber.com',
  token_url: 'https://auth.uber.com/oauth/v2/token'
)

token = OAuth2::AccessToken.from_hash(client, {
  access_token: stored_token,
  refresh_token: stored_refresh_token
})

new_token = token.refresh!

Scopes

The default scope is eats.pos_provisioning (authorization_code flow for merchant connection). Other available scopes:

  • eats.store - Store data access
  • eats.order - Order data access
  • eats.report - Report data access

Development

git clone https://github.com/dan1d/omniauth-uber-eats-oauth2.git
cd omniauth-uber-eats-oauth2
bundle install
bundle exec rspec      # Run tests (100% line + branch coverage required)
bundle exec rubocop    # Run linter (0 offenses required)
bundle exec rake       # Run both

License

The gem is available as open source under the terms of the MIT License.