Last post Nov 28, 2016 01:43 PM by InnaBoitsun
Nov 13, 2013 05:52 AM|brianCRS|LINK
I have recently created a new site using the new 2013 templates.
I enabled authentication using individual user accounts, set up the database to a remote store etc, generally as per the asp.net tutorial here:
Except I wanted to do this in web forms and VB, after some fiddling this was all working perfectly when debugging, published it to my site and again, works perfectly.
I then wanted to get additional info from facebook, so I followed this tutorial:
Again, some fiddling as there seems to be very little info on this stuff for web forms and even less in VB. But after I while I got it all translated and working under debug on localhost. Perfect. Except then I came to puclish it, the site functions properly
in most areas, and setting up a local account on the site lets me log in etc. This issue is when I now try to log in using the external site. For some reason when I click the 'for example' login with google button, I now get a 404 error.
I cannot work out at all what is going wrong with this, and obviously as its published I can't debug it, when I run it locally it works perfectly.
Does anyone have any ideas as to why I would get a 404 error in production or any idea how I can 'dubug' a production error, I tried writing any errors to a file using global but the code never gets hit as it's 404'd.
Google does seem to be doing its part correctly, as does facebook, after clicking the button my URL ends up looking like this:
locally, performing the same action:
So a little more investigation, it appears this may be something to do with the owin dll's
The OpenAuthProviders file successfully completes the following:
Response.StatusCode = 401
I then got the Google page that asks if I want to give permission to the site, so I click yes. It is then that the 404 appears.
So the production site seems to be unable to deal with the return url, I am assuming that this is the job of the OWIN security dll's.
They are all set to copy local and have all been uploaded to the site, no idea beyond that...
Nov 14, 2013 04:03 AM|Pengzhen Song - MSFT|LINK
Try to give either relative path (or substitute absolute path using ResolveUrl method) - for example, in aspx view, you can use
<form method="post" action='<%= this.ResolveUrl("~/Account/Login") %>' >
you can please refer here
Hope it can help you.
Nov 14, 2013 04:28 AM|brianCRS|LINK
Hi, many thanks for the response but I am using web forms not MVC so that solution would not apply.
I have investigated a little further and now believe this is to do with my host.
I managed to upload to a windows azure site and it works perfectly, it also works perfectly while testing on localhost, just my host where it fails..
Basically it seems to be treating the return (signin-google) as an actual page instead of the OWIN package handling it, and is therefore giving a 404, as that page does not and should not exist.
Reading up on 404 errors here:
I see this:
This problem occurs because the requested resource is mapped to a handler component that has dependencies on other files. However, these files are either missing or inaccessible.
To resolve this problem, make sure that any dependency files that the handler component has dependencies on can be accessed and are in the correct location.
At this point I don't know how to deal with that, the files are all set to copy local and they do indeed exist in the bin folder on the site so assume it should just work, is there anything else I can do or is it something that fasthosts need to do on their
Nov 28, 2016 01:43 PM|InnaBoitsun|LINK
We have the same problem, the Google and Microsoft Logins not working on live environment.
We also don't use MVC, just web forms.
All works as expected on local and pre-production environments, then we publish to Azure servers.
After investigation, we also see that OWIN doesn't handle callbacks /siginn-microsoft and
/signin-google and returns 404 Not Found.
For now we don't know how to fix the issue, still investigating...
Have you managed to solve the problem?