https://github.com/bigcommerce/omniauth-bigcommerce
OmniAuth Bigcommerce Strategy
https://github.com/bigcommerce/omniauth-bigcommerce
Last synced: about 1 year ago
JSON representation
OmniAuth Bigcommerce Strategy
- Host: GitHub
- URL: https://github.com/bigcommerce/omniauth-bigcommerce
- Owner: bigcommerce
- License: mit
- Created: 2013-09-05T00:27:06.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2024-03-27T17:23:09.000Z (over 2 years ago)
- Last Synced: 2024-11-10T00:33:35.113Z (over 1 year ago)
- Language: Ruby
- Homepage: https://developer.bigcommerce.com
- Size: 43.9 KB
- Stars: 15
- Watchers: 43
- Forks: 28
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# OmniAuth Bigcommerce Strategy
[](https://travis-ci.org/bigcommerce/omniauth-bigcommerce)
This gem provides a simple way to authenticate to Bigcommerce using OmniAuth.
## Installation
Add to your application's Gemfile:
```
gem 'omniauth-bigcommerce'
```
## Usage
First, you will need to [register an application](https://developer.bigcommerce.com).
Create a `config/initializers/omniauth.rb` initializer:
```
use OmniAuth::Builder do
provider :bigcommerce, ENV['BC_CLIENT_ID'], ENV['BC_CLIENT_SECRET'], 'users_basic_information store_v2_settings store_v2_orders'
end
```
You may also overwrite default config options:
```
Rails.application.config.middleware.use OmniAuth::Builder do
provider :bigcommerce, ENV['BC_CLIENT_ID'], ENV['BC_CLIENT_SECRET'],
{
scope: "users_basic_information store_v2_products store_v2_information",
client_options: {
site: 'https://login.bigcommerce.com'
}
}
end
```
See the [Omniauth Wiki](https://github.com/intridea/omniauth/wiki) for more information.
## Environment Variables
The gem will look for the bigcommerce oauth provider URL in the `BC_AUTH_SERVICE` environment variable.
It defaults to https://login.bigcommerce.com if the env variable is not defined.
## Auth Hash Schema
The following response format is provided back to you for this provider:
```
{
uid: '12345',
info: {
name: 'John Doe',
email: 'john.doe@example.com'
},
credentials: {
token: 'xyz123abc'
},
extra: {
raw_info: {},
scopes: 'requested_scopes store_v2_settings'
context: 'store/xyz123',
account_uuid: 'fooBar'
}
}
```
## Contributing
Fork & submit a pull request.