Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Default cookie setter in OAuth is not setting samesite = None

クローズ
#352 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@Kudze がすでに取り組んでいます。

2024年7月1日 から。

  • #353 @Kudze による — オープン

評価

難易度
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.

image

Steps to reproduce the problem

  1. Implement minimal application implementing Shopify's OAuth2 authentication (online mode = true), using this library, with default cookie setter.
  2. Install application into any Shopify store.
  3. Delete the initial customer's session. (Simulating different admin user or expired session).
  4. 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。