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

Fail to authenticate via SoundCloud, sign-in callback is trying to access a cross-origin frame

Aperta
#77 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
angularjs, javascript

Direzione di ricerca

Start with the reported callback.html and the SC.connect() call in the AngularJS 1.6 controller, then inspect how SoundCloud SDK v3.1.2 handles the sign-in callback. Reproduce the Chrome and Firefox cross-origin errors and trace why the callback cannot reach the opener. Done means the callback completes without the browser security exception and the SC.connect() promise resolves.

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

Descrizione

SoundCloud SDK v3.1.2
I registered my App approximately 1 year ago.

Today I discovered that my SoundCloud (SC) sign-in stopped working.

When I click on the button the SC pop-up appears with message "Allow “domain.com” access to your SoundCloud account?" I click connect and get the callback pop-up with the message "This popup should automatically close in a few seconds". The callback pop-up never closes. And in the dev console (for the callback pop-up) I see the following errors:

Chrome 55.0.2883.87 m (64-bit)

    VM2980 callback.html?code=3717208…&state=SoundCloud_Dialog_508d9:7 Uncaught DOMException: Blocked a frame with origin "http://domain.com" from accessing a cross-origin frame.
        at onload (http://domain.com/callback.html?code=3717208cc602aba6cc0195157ecd2b6b&state…8d9#access_token=1-166020-17988851-e8f6b064d7ccd4&scope=non-expiring:7:105)
    onload @ VM2980 callback.html?code=3717208…&state=SoundCloud_Dialog_508d9:7

Firefox 50.1.0
Error: Permission denied to access property "SC" callback.html:1:1
Learn More

My callback.html:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Connect with SoundCloud</title>
  </head>
  <body onload="window.setTimeout(window.opener.SC.connectCallback, 1);">
    <p>
      This popup should automatically close in a few seconds
    </p>
  </body>
</html>

The JavaScript function (in AngularJS 1.6 controller) that is triggered by a button on my page:

... 
      this.connect_sc = function () {
        debugger;
      // initiate auth popup
        SC.connect().then(function () {
          debugger;
          return SC.get('/me');
        }).then(function (me) {
          debugger;
          userPerma = me.permalink;
          setScUi(me.username, me.avatar_url);
          getPlaylists();
        });
      };
...

I tried to debug it putting some breakpoints. Here I don't get SC promise executed, it breaks only on the first debugger; after I click on my button.

Why is that and how to fix it?

Lingua principale
JavaScript
Stelle
388
Fork
76
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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.

Altre issue di soundcloud/soundcloud-javascript

Tutte le issue di soundcloud/soundcloud-javascript

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.