OAuthWebSecurity.VerifyAuthentication IsSuccessful returns false how do I to determine the reason?

Posted by Eonasdan on Stack Overflow See other posts from Stack Overflow or by Eonasdan
Published on 2012-10-17T17:41:45Z Indexed on 2012/10/21 17:01 UTC
Read the original article Hit count: 779

I'm using DotNetOpenAuth with a MVC 4 application. All the sudden Google auth is failing (MS is working). The stock code does this:

[AllowAnonymous]
public ActionResult ExternalLoginCallback(string returnUrl)
{
    var result = OAuthWebSecurity.VerifyAuthentication(Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl }));
    if (!result.IsSuccessful)
    {
        return RedirectToAction("ExternalLoginFailure");
    }

I know that result.IsSuccessful is false, but how do I get the reason? result.Error is null.

I also looked at this page to use log4net. I do get a log on the local dev box but not when I deploy it to a remote server.

log4net webconfig:

<log4net>
    <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="RelyingParty.log" />
      <appendToFile value="true" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="100KB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date (GMT%date{%z}) [%thread] %-5level %logger - %message%newline" />
      </layout>
    </appender>
    <!-- Setup the root category, add the appenders and set the default level -->
    <root>
      <level value="INFO" />
      <appender-ref ref="RollingFileAppender" />
    </root>
    <!-- Specify the level for some specific categories -->
    <logger name="DotNetOpenAuth">
      <level value="ALL" />
    </logger>
  </log4net>

Edit I also tried log4net to a sql db but it still didn't log anything

© Stack Overflow or respective owner

Related posts about asp.net-mvc-4

Related posts about dotnetopenauth