Access-Control-Allow-Origin error when accessing pages with admin requirement

201 views
Skip to first unread message

Xi Shen

unread,
Jul 30, 2014, 12:13:51 AM7/30/14
to google-a...@googlegroups.com
Hi,

I build a simple blog site of my own, and it has a admin entrance https://davidshen84.appspot.com/blog/admin/. This url is set to "require: admin" in the app.yaml, and only my account has access to it. This page works fine in the past, and works works on the latest dev_server. But online, when I try to access url, I saw below error in Chrome's console.

XMLHttpRequest cannot load https://www.google.com/accounts/ServiceLogin?service=ah&passive=true&contin…EJsb2cMEgJhaCIUkEhbBFmCc7OK73FNDhSUJ_TIdsgoATIUS9ZyokjQBd6r_4fpSehJGMuA0TQ. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://davidshen84.appspot.com' is therefore not allowed access.

I also post my question at https://stackoverflow.com/questions/24925070/gae-app-login-is-blocked-by-cross-origin-access. The app is developed using python, but I don't think this problem has anything to do with the language.

I think there might be some configuration changed in GAE admin console. I review the latest document, and checked the admin console. I still have no idea what is the cause. 

Xi Shen

unread,
Jul 30, 2014, 12:15:38 AM7/30/14
to google-a...@googlegroups.com
Sorry, in the app.yaml it should be "login: admin" :)

Xi Shen

unread,
Jul 30, 2014, 7:40:43 PM7/30/14
to google-a...@googlegroups.com
I just noticed that the request to that google's url is not initiated from my app. Also, I think if a user is not authenticated, he/she should be redirected to the log in page by the server, right?


On Wednesday, July 30, 2014 2:13:51 PM UTC+10, Xi Shen wrote:

Vinny P

unread,
Jul 31, 2014, 12:26:22 AM7/31/14
to google-a...@googlegroups.com
On Wed, Jul 30, 2014 at 6:40 PM, Xi Shen <david...@gmail.com> wrote:
I just noticed that the request to that google's url is not initiated from my app. Also, I think if a user is not authenticated, he/she should be redirected to the log in page by the server, right?


I went to the URL you provided ( https://davidshen84.appspot.com/blog/admin/ ) to test, and the page isn't prompting me to log in/auth: http://i.imgur.com/WAWUCzH.png

Did you find the issue or are you modifying the admin section?
 

-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

Xi Shen

unread,
Jul 31, 2014, 2:25:24 AM7/31/14
to google-a...@googlegroups.com
Yeah~I am looking into my app.yaml file. I reckon there are something broken there. Thanks buddy :)

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/whBBjcInpDE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages