Default cookie setter in OAuth is not setting samesite = None
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- php
調査の方向性
OAuth Cookie が設定される src/Auth/OAuth.php の 351 行目付近を調査し、埋め込み Shopify 管理画面フローに関係する Cookie の動作を確認します。iframe を使って online-mode のトークン交換を再現するか、Repository に用意されている場合は対象を絞ったテストを追加します。Cookie が保存され、Shopify 管理画面で OAuth が成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Issue summary
The samesite parameter is being ommited from setcookie function in OAuth2 process: https://github.com/Shopify/shopify-api-php/blob/main/src/Auth/OAuth.php#L351, causing the default Lax mode to be selected.
This causes "Perform Token Exchange" step in https://shopify.dev/docs/apps/build/authentication-authorization/session-tokens#request-flow-using-a-session-token to fail when embedded page is loaded through an iframe (for example from Shopify admin panel), because the cookies will not be saved.
Expected behavior
The cookies should be set and OAuth should succeed in Shopify admin panel.
Actual behavior
The cookies are not set and OAuth fails in Shopify admin panel.
Steps to reproduce the problem
- Implement minimal application implementing Shopify's OAuth2 authentication (online mode = true), using this library, with default cookie setter.
- Install application into any Shopify store.
- Delete the initial customer's session. (Simulating different admin user or expired session).
- Try to perform "Token Exchange" from Shopify admin panel.
Reduced test case
Checklist
- I have described this issue in a way that is actionable (if possible)
- I have created a merge request fixing this issue.
- 主要言語
- PHP
- スター
- 473
- フォーク
- 193
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
InvoiceSettled is answered 200 when the invoice cannot be re-fetched, so BTCPay never redelivers itオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
btcpayserver/woocommerce-greenfield-plugin#93 ·
メンテナーはふだん 1 日以内に返信
-
kind/bug status/triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
🐛 [Bug] Bulk CSV import stores hide_from_combined_view=FALSE as a string, which hides every account from Sent, Junk, Trash and Drafts対応中かも @exSnake が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
opnsense/core#11052 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100