1

I'm currently developing a spotify app which requires oAuth to sign into GetGlue.

It successfully loads the authentication dialog box with the GetGlue service. However, when making its oauth callback, it returns the following JavaScript error: "Not allowed to load local resource: sp://getglue/" (sp://getglue being my app name).

I'm using the showAuthenticationDialog function as specified in the Spotify documentation:

auth.showAuthenticationDialog('http://getglue.com/oauth/authorize/?oauth_token='+_token+'&oauth_callback=sp://getglue', 'sp://getglue', {
    onSuccess : function(response) {
        console.log("Response: " + response);
    },
    onFailure : function(error) {
        console.log("Error: " + error);
    },
    onComplete : function() { }
});

The closest to my issue I could find on the web was this stackoverflow issue - Twitter ouath callback in Spotify Apps. In that, the response says that:

"showAuthenticationDialog works by watching for requests to the URL given in the second parameter, then intercepting them and passing it to you in the callback instead"

This doesn't seem to be happening in my case?

Closing this authentication window then returns an error of 1? (e.g. "Error: 1" in my console.log)

Is there something that I'm missing here in my Spotify oAuth implementation?

Any help on this would be much appreciated.

Community
  • 1
  • 1

1 Answers1

0

I think the problem is that GetGlue doesn't like the sp://getglue callback URL. As the answer you linked goes on to say, try using a http://… URL instead.

iKenndac
  • 18,537
  • 3
  • 32
  • 50
  • Thanks for your response @iKenndac! That appears to have worked (the authorisation window closes without error now). I didn't fully realise what you'd meant in the other answer. I've put a http:// url in both the callback to GetGlue and the second parameter in that method and it does what is expected now.Out of interest, are there any cases in which the dummy URL I've put into the callback will actually be returned instead of the window closing? Is there a best practice for handling these situations? – thatpatrickguy Jun 24 '12 at 22:33