"No OpenID endpoint found" on Azure Website - azure

I have a strange issue with a MVC 3 app running as an Azure Website. I have had issues with Azure in the past, but the new Website concept works almost perfectly, except for this:
DotNetOpenAuth.Messaging.ProtocolException: No OpenID endpoint found.
This only happens with Google, only on Azure. Running locally it works fine, running on AppHarbor it works fine, but on Azure every attempt to use Google for OpenID login will result in a server error due to that exception (tracked using Airbrake).
See for yourself, try logging in with Google on my website and if you immediately get a server error page it means DNOA is throwing up. All other login methods work fine, including Yahoo and AOL which are also OpenID.
P.S.: Don't try it too many times though, AirBrake will happily spam my email address :<

Try adding this code to your web site before calling OpenIdRelyingParty.CreateRequest:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
In some Azure configurations this has been shown to resolve the issue.

I had this function in global.asax:
AreaRegistration.RegisterAllAreas();
After removing this line, all works perfectly.
I've added some areas in my app, this function was added automatically by VS2012.

Related

ASP.NET Core 5 MVC web app returning bad request errors in some pages after deployment to IIS

I have tried everything. I configured Windows Server 2019 according to Microsoft documentation and I successfully deployed a .NET 5 web application to the IIS.
I can get to the login page. I can even get to the forgot password page and they show themselves fine. However when I try to do any action (send the forgot password link or login to the page) I get a "Bad Request" from the server. I haven't found a way to explain why.
I have tried several, and I mean several things found Googling around but nothing helps. This include disabling https within the .NET Core application, trying to get a detailed error page using the app.UseDeveloperExceptionPage(); instruction inside Startup, etc etc but nothing works. I always receive this page trying to execute any action:
If someone could help or point me into the right direction, I will really, REALLY appreciate it.
Thank you
PD: In case it has anything to do with the problem, the error, at least the two that I can reproduce (because I can't even log in), happens, I think (maybe don't) when redirecting to another page in Microsoft Identity.
EDIT: code was asked by one of you. Thank you.
As you see, there's nothing specific in the forgot password screen for my application. This is scaffold code from Microsoft Identity. I even edited it and just let one line of code inside it, which is the default return code anyway as follow:
public async Task<IActionResult> OnPostAsync()
{
return RedirectToPage("./ForgotPasswordConfirmation");
}
As you can see, there's nothing special with that code. Here's the html that calls it, again, is a scaffold of Microsoft Identity with little to no changes (by little, I mean, maybe some CSS and a new value of view data):
But then again, forgot password page actually shows and seems well in the front end, but immediately I try to enter my email and click enter in this page, (also, just a scaffold of Microsoft Identity):
Nothing happens. I receive the bad request. There's NO magic nor custom code here. Something silly is going on.
EDIT II: YES, locally it works perfectly. The strange behavior happens only when deployed to IIS.
EDIT III: I coded and enabled logging in my .NET Core APP and wrote that to a file, and I think I finally got, at least the error (not the reason yet):
But why?? Cookies are enabled in the server browser without avail, same issue. Someone has a better idea than disabling anti forgery rules to login and forgot password pages?
Thank you
For some reason, when I deployed the first version of my app into IIS, I thought it was a good idea to just browse it from the IIS link. Of course, in a new mounted Windows Server 2019, IE is still the default browser. I connected directly to the IP of my web app via VPN, but used Chrome this time. Guess what? All problems disappeared. Yes, it's a bad idea to try to use a modern framework like .NET Core Identity with IE.

Could not retrieve the CDN endpoints in subscription with ID

Searched Google and so - no luck.
Just got this message in Azure for 3 CDN endpoints.
There seems no way to know what is going on without MS support. It is a test account and I do not recall setting this. I have been through similar obfuscated MS error messages only to discover that Azure had crashed.
What does it mean?
This isn't really a direct answer, but could help with the general problem of "what happens if the CDN goes down?".
There is a recent development called the "Progressive Web App".
Basically unless served by localhost, everything has to be over https, but script is cached as a local application in your browser.
When your app makes requests to the registered domain, these are intercepted by a callback you put in your serviceWorker.js, so you can cache even application data locally, and sync the local data occasionally with the server (or on receive events if you're using webSockets).
Since the Service Worker intercepts REST calls to the registered domain, this in theory makes it fairly easy to add to just about any framework.
https://developers.google.com/web/fundamentals/getting-started/codelabs/your-first-pwapp/
Sometimes there is a (global) problem with the CDN. It happend before.
You can check the azure CDN status on this page: https://azure.microsoft.com/en-us/status/
At this moment everything looks good, you still have problems?

This webpage is not available

I am newbie in Azure development ,I am migrating an existing asp.net application to be hosted as cloud service ,everything works just fine locally (on dev. AppFabric) but when I publish it on cloud and after I try to singin on my signin.aspx page it keeps giving me "This webpage is not available" error .
after that refreshing the page gives me "HTTP Error 503. The service is unavailable." error
my signin page does a lot of stuff (calling db procedure ,setting user session) before redirecting to default page [I am using the free azure trial account]
what may cause the problem ,how can I debug ,why everything works fine on the emulator ?
Checking the event Viewer I found that the problem was in "Debugger.Break ();" inside a class it seems like that line just freaks the runtime out and causes it to lose control and recycle the Application Pool and stopping the service !!!!
You should set up a remote desktop connection to your web role instance and look at the Event Log for IIS. You will want this for development and testing independent of your current issue.
Links:
http://www.windowsazure.com/en-us/develop/net/common-tasks/remote-desktop/
http://msdn.microsoft.com/en-us/library/windowsazure/gg443832.aspx

Getting AccessTokenFailed using ServiceStack FacebookAuthProvider

trying to use facebook's oauth with servicestack, i'm hitting url
localhost:60782/api/auth/facebook
being taken to facebook's auth dialog but after clicking allow, i'm being redirected back to my redirect URL with #f=AccessTokenFailed
localhost:60782/api/users#f=AccessTokenFailed
anyone have any idea what's going on here?
I had a similar problem when setting the facebook authentication up. I found it difficult to pinpoint the problem because servicestack catches the web exception and effectively discards it. To work out what was happening I downloaded and compiled the service stack code. I was then able to change my project to reference my local service interace DLL which enabled me to set a debug point in the facebook auth provider.
In my case I was getting a proxy authentication error, caused by the server attempting to contact facebook without any credentials. I overcame this by reconfiguring my dev pc and production pc so that they didnt go via the proxy.

Why do I get a 401 Unauthorised error calling the Bing Geocode service from SharePoint but not from a WinForms app?

I'm developing a SharePoint Timer Job to geocode some lists of addresses held on our SharePoint site.
I'm using code based on this MSDN sample to do the actual Geocoding request.
The problem I get is that when I call the service from SharePoint 2010 (running locally) I get a 401 unauthorised error in return.
Interestingly, I have also created a small winforms application which does the same thing (but without SharePoint/IIS) using the same code which works perfectly.
I'm setting the credentials the same way on both apps as follows:
request.Proxy.Credentials = CredentialCache.DefaultCredentials;
I'm an enterprise user and I'm using the same key on both apps - but one works and one doesn't - any ideas why this might be? Is it something i need to set in IIS perhaps?
I tried setting Pipelined = false on the request which was a suggestion I read about on but that didn't seem to work.
Any suggestions gratefully accepted.
Looks like you solved it by changing the identity of the application pool.
The other way to do it is to say that the web service call should be made using the identity of the user that sent the request to SharePoint. To do that try something like:
using (((WindowsIdentity)HttpContext.Current.User.Identity).Impersonate())
{
WCFTestService.ServiceClient myService = new WCFTestService.ServiceClient();
Response.Write(myService.GetData(123) + "<br/>");
myService.Close();
}

Resources