500 server error on App Engine when using OpenID Users API on custom domain

70 views
Skip to first unread message

Joel E

unread,
Jul 29, 2014, 1:41:29 PM7/29/14
to google-a...@googlegroups.com
I posted the details of this issue on StackOverflow here but basically the Users API is crashing when accessed by an app running on a custom domain. I have not been able to get any help with this issue and it would be great to get an answer from someone at Google as this seems to be an issue with App Engine's internal code. I'd be happy for any suggestions or help at this point though.

Thanks!

Mihail Russu

unread,
Jul 29, 2014, 6:05:42 PM7/29/14
to google-a...@googlegroups.com
Are there any error details in the Logs section that you can provide?

Just last Friday I transferred an app from .appspot.com to a custom domain and everything worked great as soon as I changed the callback/redirect URLs on OAuth providers' end. Could it be that you simply forgot to update them? (this is unlikely to cause a 500 on AppEngine's end but it's a start)

Mihail.

Joel E

unread,
Jul 29, 2014, 6:18:29 PM7/29/14
to google-a...@googlegroups.com
Could you explain what you mean by the callback/redirect URL? I didn't read anything about that in the documentation. Also, nothing from the error appears in the logs since the crash happens in app engine's internal code.

Thanks!

Mihail Russu

unread,
Jul 29, 2014, 7:07:09 PM7/29/14
to google-a...@googlegroups.com
Most OAuth providers require you to specify full callback url (in the request headers as well as in the control panel of their websites) so when changing domains you'd also need to update the URL on their end but I didn't realize until now that you are having issues with OpenID and NOT with OAuth, I am not sure if it's the same there.

Joel E

unread,
Jul 29, 2014, 7:35:03 PM7/29/14
to google-a...@googlegroups.com
Oh, I think I understand but I don't think it solves the issue. See, the App Engine user's API accepts relative URLs and then takes care of processing the call to the openID provider. Here's how my code works:

String LogInURL = userService.createLoginURL("/main.jsp", null, openid_identifier, null);
resp.sendRedirect(LogInURL);
I take the URL of the provider from the user (openid_identifier) and send it to the App Engine Users API to create a redirect URL. Then I send the user to the provider through that URL. The user first logs in through their provider but on return to my app they land on a 500 error page instead of being redirected through to /main.jsp. If I start the process from my appspot.com domain instead it goes through to /main.jsp just fine.

Thanks for trying though!

Joel E

unread,
Jul 29, 2014, 7:56:16 PM7/29/14
to google-a...@googlegroups.com
Well I was playing around with the "/main.jsp" part of the above code to see if I could get something working and oddly enough it seems that adding the custom domain to it fixes the 500 error without messing it up on appspot! Thanks for the help!
Reply all
Reply to author
Forward
0 new messages