title: Translating C# to VB for OWIN Single Sign On
body: <p>I am trying to use Single Sign On, using the OWIN libraries. The code that I have that works is in MVC C#. I am trying to translate it to Form website in VB. Here is the C# code, that works:</p>
  
  <pre><code>public void ConfigureAuth(IAppBuilder app)
  {
      app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
      app.UseCookieAuthentication(new CookieAuthenticationOptions());
      app.UseWsFederationAuthentication(
          new WsFederationAuthenticationOptions
          {
              Wtrealm = realm,
              MetadataAddress = metadata,
              Notifications = new WsFederationAuthenticationNotifications
              {
                  AuthenticationFailed = context =&gt;
                  {
                      context.HandleResponse();
                      context.Response.Redirect("Home/Error?message=" + context.Exception.Message);
                      return Task.FromResult(0);
                  }
              }
          });
  }
  </code></pre>
  
  <p>And here is the VB.Net code:</p>
  
  <pre><code>Public Sub ConfigureAuth(app As IAppBuilder)
      app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType)
      app.UseCookieAuthentication(New CookieAuthenticationOptions())
      Dim authOption As WsFederationAuthenticationOptions = New WsFederationAuthenticationOptions()
  
      app.UseWsFederationAuthentication(New WsFederationAuthenticationOptions() With {
          .Wtrealm = realm,
          .MetadataAddress = metadata
      })
  
  End Sub
  </code></pre>
  
  <p>I don't think I got the <code>UseWsFederationAuthentication</code> code properly translated, as I left out the Notifications stuff, as I could not figure out how to translate it. While no error is thrown, it does not properly authenticate.  Can anyone tell me if there is an issue with the translation and how to fix it?</p>