title: Denied email permission with Facebook authentication through Owin
body: <p>How do I re-ask user to accept email permission after it was denied? </p>
  
  <p>My code is:</p>
  
  <p><strong>Startup.Auth.cs</strong></p>
  
  <pre><code>app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
  
  var facebookOptions = new FacebookAuthenticationOptions
  {
      AppId = "0000",
      AppSecret = "0000",
      BackchannelHttpHandler = new FacebookBackChannelHandler(),
      UserInformationEndpoint = "https://graph.facebook.com/v2.4/me?fields=id,name,email,first_name,last_name,location",
      Provider = new FacebookAuthenticationProvider
      {
          OnAuthenticated = context =&gt;
          {
              context.Identity.AddClaim(new System.Security.Claims.Claim("FacebookAccessToken", context.AccessToken));
              return Task.FromResult(true);
          }
      }
  };
  facebookOptions.Scope.Add("email");
  app.UseFacebookAuthentication(facebookOptions);
  </code></pre>
  
  <p>Using this helper class to extract only the info that i need:</p>
  
  <pre><code>/* I have taken validation and error handling out */
  public static class ExternalLogin
  {
      public static ExternalLoginInfo get(IOwinContext context)
      {    
          var auth = context.Authentication;
          var loginInfo = auth.GetExternalLoginInfo();
          var identityInfo = auth.GetExternalIdentity(DefaultAuthenticationTypes.ExternalCookie);      
  
          return new ExternalLoginInfo { 
              email = loginInfo.Email
             ,name = loginInfo.ExternalIdentity.Name 
             ,provider = loginInfo.Login.LoginProvider
             ,user_access_token = identityInfo.FindFirstValue("FacebookAccessToken")
          };
      }
  }
  
  public class ExternalLoginInfo
  {
      public string email { get; set; }
      public string name { get; set; }    
      public string provider { get; set; }
      public string user_access_token { get; set; }
  }
  </code></pre>
  
  <p>When user denies email permission email is set to null. </p>
  
  <p><strong>oauthcontroller.cs</strong></p>
  
  <pre><code>  public ActionResult callback()
          {          
              var loginInfo = ExternalLogin.get(HttpContext.GetOwinContext());
  
              /* User denied permission, ask again */
              if(String.IsNullOrEmpty(loginInfo.email))
              {
                  /* Here I can display a message which helps 
                     user understand  why I need hers/his email 
                     and ask to accept permission */
               return View("need_your_email_dude");
              }
             ...
  </code></pre>
  
  <p>But how do I trigger permission form again from need_your_email_dude <strong>view</strong>?</p>