title: Redirect loop with .Net MVC Authorize attribute with ADFS Claims
body: <p>I have a problem configuring ADFS with my .Net MVC 5 app.</p>
  
  <p>I have configured my project in VS 2015 to use claims and it works ok, but I have an issue. </p>
  
  <p>I can sign in, ussing ADFS, I can check user roles etc. The problem occures when i try to use </p>
  
  <pre><code>[Authorize(Roles="somenonExistingRole")]
  </code></pre>
  
  <p>despite that I'm already authenticated I am redirected to ADFS page, when Authentication takes place again, and I'm redirected to my page, where loop occures. Page send me to ADFS portal , ADFS redirects my to portal, and after few tries i get an error from ADFS ( to many requests ) </p>
  
  <p>Do I have to implement something like Role provider by myself? or i need to configure something extra. Maybe i could just limit number of tries? Why am I redirected to ADFS when I have my roles allready?</p>
  
  <p>there is not much to show actualy in the code, ut as requested:
  the controller that im testing: </p>
  
  <pre><code> public class HomeController : Controller
      {
          public ActionResult Index()
          {
              return View();
          }
          [Authorize]
          public ActionResult About()
          {
              var u = HttpContext.User;
  
  
              if (u.IsInRole("/"))
              {
                  ViewBag.Message = "User is in role.";
              }
              else
              {
                  ViewBag.Message = "User is NOT in role.";
              }
  
              return View();
          }
          [Authorize(Roles = "/nonexistingRole")]
          public ActionResult Contact()
          {
  
              ViewBag.Message = "Your contact page.";
  
              return View();
          }
      }
  </code></pre>
  
  <p>and the configure auth section </p>
  
  <pre><code>public void ConfigureAuth(IAppBuilder app)
  {
      app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
  
      app.UseCookieAuthentication(new CookieAuthenticationOptions());
  
      app.UseWsFederationAuthentication(
          new WsFederationAuthenticationOptions
          {
              Wtrealm = realm,
              MetadataAddress = adfsMetadata, 
  
          });
  }
  </code></pre>