Sha256: ad66e842d9041a11cb4c27cc21ad20391ed94197c99071e7d54bdb5926c15a8b

Contents?: true

Size: 1.35 KB

Versions: 48

Compression:

Stored size: 1.35 KB

Contents

# Handling changes in access scopes
## Updating the list of scopes the app requests

Your app specifies the [access scopes](https://shopify.dev/api/usage/access-scopes) it requires in the Shopify App initializer, located at`config/initializers/shopify_app.rb`. To modify this list, update the comma-delimited configuration option:

```ruby
config.scope = "read_products,write_discounts"
```

## Requesting new scopes from merchants

The Shopify App gem will automatically request new scopes from merchants for both shop/offline and user/online tokens. To enable your app to reauth via OAuth on scope changes, you can set the following configuration flag in your `config/initializers/shopify_app.rb`:
```ruby
config.reauth_on_access_scope_changes = true
```

## ShopAccessScopesVerification
The `ShopifyApp::ShopAccessScopesVerification` concern helps merchants grant new access scopes requested by the app. The concern compares the current access scopes granted by the shop and compares them with the scopes requested by the app. If there is a mismatch in configuration, the merchant is redirected to login via OAuth and grant the net new scopes.

To activate the `ShopAccessScopesVerification` for a controller add `include ShopifyApp::ShopAccessScopesVerification`:
```ruby
class HomeController < AuthenticatedController
  include ShopifyApp::ShopAccessScopesVerification
```

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
shopify_app-22.5.1 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-22.5.0 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-22.4.0 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-22.3.1 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-22.3.0 docs/shopify_app/handling-access-scopes-changes.md
ruby_shopify_app-1.3.3 docs/shopify_app/handling-access-scopes-changes.md
ruby_shopify_app-1.3.2 docs/shopify_app/handling-access-scopes-changes.md
ruby_shopify_app-1.3.1 docs/shopify_app/handling-access-scopes-changes.md
ruby_shopify_app-1.3.0 docs/shopify_app/handling-access-scopes-changes.md
ruby_shopify_app-1.2.0 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-22.2.1 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-22.2.0 docs/shopify_app/handling-access-scopes-changes.md
ruby_shopify_app-1.1.0 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-22.1.0 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-22.0.1 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-22.00.0 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-21.10.0 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-21.9.0 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-21.8.1 docs/shopify_app/handling-access-scopes-changes.md
shopify_app-21.8.0 docs/shopify_app/handling-access-scopes-changes.md