Skip to content

Instantly share code, notes, and snippets.

@b-tiwari
Created November 6, 2017 04:23
Show Gist options
  • Select an option

  • Save b-tiwari/7d0586a7f9e65600a59197771bc83b48 to your computer and use it in GitHub Desktop.

Select an option

Save b-tiwari/7d0586a7f9e65600a59197771bc83b48 to your computer and use it in GitHub Desktop.
Claims based identity in MVC (HomeController.cs)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using csWinAuthWClaims.Attributes;
namespace csWinAuthWClaims.Controllers
{
    [AppClaimsAuthorize(ClaimType="myAppUserRole", ClaimValue="myAppAdmin")]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";
            return View();
        }
        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";
            return View();
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment