Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Default cookie setter in OAuth is not setting samesite = None

Chiusa
#352 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@Kudze ci sta già lavorando.

Dal 1/7/2024.

  • #353 di @Kudze — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
php

Direzione di ricerca

Ispeziona src/Auth/OAuth.php intorno alla riga 351, dove viene impostato il cookie OAuth, e verifica il comportamento dei cookie coinvolto nei flussi dell’amministrazione Shopify incorporata. Riproduci lo scambio del token in modalità online con un iframe oppure aggiungi un test mirato se il repository ne fornisce uno; il lavoro è completo quando i cookie vengono salvati e OAuth ha esito positivo nel pannello di amministrazione Shopify.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
PHP
Stelle
473
Fork
193
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.