I created the example app of this tutorial
It works fine when I am not connected to a vpn or work related network. Once I login it fails with the following error:
I guess this has to do with the SSL certificates. I do have cert installed for the login.microsoftonline.com site:
Something must go wrong with the certificate or might it be a proxy issue? Is there anybody who can give me advise what to look for?
I have been able to solve the problem, it has to do with a proxy:
I added the following sites to my trusted sites list:
https://*.microsoft.com
https://*.microsoftonline.com
https://*.microsoftonline-p.com
https://*.outlook.com
I added the following to the web.config file of the proyect:
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="false">
<module type = "<YourNameSpace>.MyProxy, <YourNameSpace>" />
</defaultProxy>
</system.net>
Then I added a new class with code for MyProxy:
namespace <YourNameSpace>
{
public class MyProxy : IWebProxy
{
public ICredentials Credentials
{
get { return new NetworkCredential(@"<UserName>", @"<Password>", @"<Domain(optional)>"); }
set { }
}
public Uri GetProxy(Uri destination)
{
return new Uri("http://<YourProxy>:<Port>");
}
public bool IsBypassed(Uri host)
{
return false;
}
}
}