You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@
3
3
Note: For changes to the API, see https://shopify.dev/changelog?filter=api
4
4
## Unreleased
5
5
6
+
- Add support for expiring offline access tokens with refresh tokens. See [OAuth documentation](docs/usage/oauth.md#expiring-offline-access-tokens) for details.
7
+
6
8
### 15.0.0
7
9
8
10
- ⚠️ [Breaking] Removed deprecated `ShopifyAPI::Webhooks::Handler` interface. Apps must migrate to `ShopifyAPI::Webhooks::WebhookHandler` which provides `webhook_id` and `api_version` in addition to `topic`, `shop`, and `body`. See [BREAKING_CHANGES_FOR_V15.md](BREAKING_CHANGES_FOR_V15.md) for migration guide.
-**Authorization Code Grant**: The OAuth flow will request expiring offline access tokens by sending `expiring: 1` parameter
329
+
-**Token Exchange**: When requesting offline access tokens via token exchange, the flow will request expiring tokens
330
+
331
+
The resulting `Session` object will contain:
332
+
-`access_token`: The access token that will eventually expire
333
+
-`expires`: The expiration time for the access token
334
+
-`refresh_token`: A token that can be used to refresh the access token
335
+
-`refresh_token_expires`: The expiration time for the refresh token
336
+
337
+
### Refreshing Access Tokens
338
+
339
+
When your access token expires, you can use the refresh token to obtain a new access token using the `ShopifyAPI::Auth::RefreshToken.refresh_access_token` method.
|`shop`|`String`| Yes | A Shopify domain name in the form `{exampleshop}.myshopify.com`. |
345
+
|`refresh_token`|`String`| Yes | The refresh token from the session. |
346
+
347
+
#### Output
348
+
This method returns a new `ShopifyAPI::Auth::Session` object with a fresh access token and a new refresh token. Your app should store this new session to replace the expired one.
349
+
350
+
#### Example
351
+
```ruby
352
+
defrefresh_session(shop, refresh_token)
353
+
begin
354
+
# Refresh the access token using the refresh token
0 commit comments