SoundCloud authentication failed because the sign-in callback is attempting to access a frame from a different origin

Latest SoundCloud SDK Version

About a year ago, I successfully registered my App.

To my surprise, today I found that the SoundCloud (SC) sign-in feature is no longer working.

Upon clicking the button, a SC pop-up window appears with the message "Allow “domain.com” access to your SoundCloud account?". After clicking connect, a callback pop-up displays the message "This popup should automatically close in a few seconds". Unfortunately, the callback pop-up never closes and I noticed some errors in the console:

Using 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

Using Firefox 50.1.0

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

The content of 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 AngularJS 1.6 component controller function 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 attempted to debug the issue by adding breakpoints. However, the SC promise does not execute, it only pauses at the first debugger; after clicking the button.

Why is this happening and how can it be resolved?

Answer №1

I experienced a similar issue.

My solution involved setting up a redirect. It seems the callback was only registered with the "www" version of my website, so accessing it without that caused problems.

After implementing a redirection to ensure my website always includes the "www", everything started functioning correctly!

Sharing this in case it can assist others facing the same issue.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I'm having trouble making a Javascript ajax request to my Web API controller page. It seems like I just can't figure out the correct URL

Currently, I am facing an issue with my registration page where I am attempting to save input fields into a new record in the Users table. <button class="btn-u" type="submit" onclick="submitclicked()">Register</button> The click event trigger ...

Leveraging the power of NextJS and Strapi: Efficiently fetching multiple API pages with a single getStaticPaths

Both NextJs and Strapi offer guidance on fetching data from a single collection type within Strapi. The process involves the following code snippet: const pages = await (await fetch(getStrapiURL("/pages"))).json(); const paths = pages.map((page) => { ...

Issue: Troubleshooting data serialization process using getStaticProps in Next.js

I attempted to retrieve data from an API, but unfortunately encountered the following error: Server Error Error: Issue with serializing .results returned from getServerSideProps in "/". Reason: JSON serialization does not support undefin ...

Is it possible to utilize a computed property for dynamically styling a table row based on certain conditions?

I have a table of users that I am currently rendering, and my goal is to highlight the entire row only for the current user. My initial thought was to use a computed property to achieve this, but I seem to be facing some difficulties in making it work. I ...

What is the best way to apply a conditional binding with v-model in Vue.js?

When working with JavaScript, you can utilize object spreading to include optional values like shown below: const payload = { name: "Joseph", ...(isMember && { credential: true }) }; In React, passing props optionally in JSX is as simple as this: &l ...

The Json parsing failed to deserialize the API response

Struggling to send a JSON to my API, I've tried various solutions but still can't figure out what's going wrong. I'm stuck on this post call function: @PostMapping(path = "ts/sts") public void saveTestStep(@RequestBody Tes ...

Store a collection of objects in an array and assign it to a variable in JavaScript within a React application

Is there a way to loop through this Json data and extract the attribute values into an array for insertion into a constant variable in React? For example: { "data": [ { "id": "1", "type": "vid ...

The TypeScript type 'Record<string, string>' cannot be directly assigned to a type of 'string'

I can't seem to figure out why this code isn't working. I've encountered similar issues in the past and never found a solution. The snippet goes like this: type dataType = { [key: string]: string | Record<string, string>; ...

Having trouble displaying nested JSON data in a DataTable

Hey, I've got a complex JSON array that's pretty nested and minified: { "items" : [ { "track" : { "album" : { "name" : "Pressure Makes Diamonds" }, "arti ...

Experience the classic game of rock-paper-scissors brought to life through JavaScript and HTML,

I've been working on a rock, paper, scissors game in JavaScript and I'm struggling to get the wins and losses to register correctly. The game keeps resulting in a draw even though I've checked my code multiple times. It's frustrating be ...

Common reasons why you may encounter the error "Uncaught TypeError: $(...).DataTable is not a function"

I recently started working with DataTable.js, and when I tried to integrate it into my ASP.NET Core MVC 5.0 project, I encountered an error: Uncaught TypeError: $(...).DataTable is not a function After doing some research on Google, I discovered that this ...

Restrict the character count in Vue Material chips

Currently, I am utilizing the Vue Material Chips component to gather string arrays. My goal is to limit the character length of each string within the array to 30 characters. The component offers a md-limit prop which restricts the number of strings in th ...

Data loss occurs when the function malfunctions

Currently, I am working with Angular version 11. In my project, I am utilizing a function from a service to fetch data from an API and display it in a table that I created using the ng generate @angular/material:table command. Client Model export interfac ...

Unable to retrieve ng-model value in AngularJS controller

I am facing an issue while trying to access the ng-model name viewProfileCtrl.monthsForm.institution in my Controller. <select class="perf-select" ng-model="viewProfileCtrl.monthsForm.institution" ng-options="inst.institution ...

Use JavaScript to find any text enclosed within [quote] and [/quote] tags and then replace it with <div class="quote-text">foo text</div>

Hey there! I have a specific text format that looks like this: [quote]foo text[/quote] and I would like to convert it to the following: <div class="quote-text">foo text</div> Do you have any idea how I can achieve this using JavaScript? Cu ...

Display the initial page and activate the first navigation button when the page loads

Greetings to everyone. I am new to the world of jquery and currently in the process of learning. This is my script: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"> </script> <script> $(function () { $ ...

Adjust the dimensions of an element using Protractor

When using the getSize method, I am able to determine the size of an element but I am struggling to understand how to change its height. To provide some additional context, my goal is to verify if a user can resize a textarea element. Should I simply adju ...

The functionality of WrapAll is not functioning properly in React JS

$('p').wrapAll($('<div class="wrapper"></div>')); .wrapper { background: #EEE; margin: 10px; padding: 5px; border: 1px solid black; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery. ...

Creating dynamic routing functionality in Angular 8 allows for a more personalized and

I am struggling with setting up routing in Angular 8. Here is how I am trying to do it: 'company/:id/activity' 'company/:id/contacts' However, I am not receiving any params in the activatedRoute: this.activateRoute.params ...

Vue.js routing and mixin dilemma

Calling all Vue developers! I am currently working on a vuebnb tutorial and running into an issue with routing and mixins. I have attempted to assign data before entering the router using the beforeRouteEnter guard, but it seems like my template is being r ...