Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currenty trying to write my first ever stack exchange application and was using the SE Jaavascript SDK v 2.0 for this purpose.

I am stuck on the point of authenticating the user. I followed the steps mentioned here

I am able to complete the call to SE.init successfully, However, when I call SE.authenticate, I get a login window where-in I login using my StackExchange account. At this point, I get an error that says Unexpected domain on proxy URL.

I would like to point out that I am using a cloud-based IDE at and hence I can test-run this application within the preview URL provided by them. In my case, I access the preview URL as follows :

Here is my code snippet for the JS file that contains all the initialization and authentication logic:

$(document).ready(function() {
  SE.init({clientId: 1880, 
    key: '396D79cbzmt3w*Pf)E7AUw((', 
    // Used for cross domain communication, it will be validated
    channelUrl: '',
    // Called when all initialization is finished
    complete: function(data) { 
            .text('Run Example With Version '+data.version); 

  $("#login-button").click(function() {

        success: function(data) { 
                'User Authorized with account id = ' + 
                data.networkUsers[0].account_id + ', got access token = ' + 
        error: function(data) { 
            alert('An error occurred:\n' + data.errorName + '\n' + data.errorMessage); 
        networkUsers: true
share|improve this question
up vote 0 down vote accepted

Your apps registered domain must match that the url passed as channelUrl.

You'll need to update your app's domain from to (or whatever other full, stable domain your app ends up at).

share|improve this answer
Thanks for the note. I updated my app's OAuth URL and now I get stuck at the authentication page. Chrome gives me the following error message: Unable to post message to Recipient has origin I cannot run an HTTP server on port 80 since that is already in use. Is there a way I can work around this? – Prahalad Deshpande Aug 12 '13 at 18:38
I finally managed to get this working. I realized, that working within the preview URL of the cloud IDE provider is not going to solve the problem due to the port number constraints. I deployed this app on heroku and am now able to get this working. Thanks a ton for the guidance. – Prahalad Deshpande Aug 17 '13 at 5:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .