Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Active Directory Groups and Roles with AD FS Single Sign On

$
0
0

Hello,

This is my first site in VS and a newbie to any type of code. I have created a site where SSO is enabled and working as expected. The user is redirected from my project URL to the SSO login and after successful login they are presented with the project site. My goal is to limit what the user sees in the site based on their group in Active Directory. However, no matter how I setup my web.config and sitemap the users are presented with all the menu items. I am using server 2012 R2, VS 2015, AD FS 3.0 with this project and real IIS not IIS express. I have three groups in AD with the users associated. Could you let me know what I am missing? Is there something in the Code Behind that I need to add? I have checked several examples but not sure how to get this configured.

WEB CONFIG<?xml version="1.0" encoding="utf-8"?><!--
  For more information on how to configure your ASP.NET application, please visit
   http://go.microsoft.com/fwlink/?LinkId=301880

  --><configuration><appSettings><add key="ida:ADFSMetadata" value="https://FQDN/FederationMetadata/2007-06/FederationMetadata.xml" /><add key="ida:Wtrealm" value="https://myapplication" /></appSettings><system.web><authentication mode="Windows"/><roleManager enabled="true" defaultProvider="WindowsProvider"><providers><add name="WindowsProvider" type="System.Web.Security.WindowsTokenRoleProvider" /></providers></roleManager></system.web><system.web><siteMap defaultProvider="XmlSiteMapProvider" enabled="true"><providers><add name="XmlSiteMapProvider"
          description="Default SiteMap provider."
          type="System.Web.XmlSiteMapProvider "
          siteMapFile="Web.sitemap"
          securityTrimmingEnabled="true" /></providers></siteMap></system.web><location path="~/PAGE.aspx"> <!-- testing page --><system.web><authorization><allow roles="DOMAIN\Group" /> <!--  tried different methods such as usernames and without domain. --><deny users="*" /></authorization></system.web></location><location path="Account"><system.web><authorization><allow users="*" /></authorization></system.web></location><system.web><authorization><deny users="?" /></authorization><compilation debug="true" targetFramework="4.5.2" /><httpRuntime targetFramework="4.5.2" /><pages><namespaces><add namespace="System.Web.Optimization" /></namespaces><controls><add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /></controls></pages><httpModules><add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" /></httpModules></system.web><system.webServer><modules><remove name="FormsAuthentication" /><remove name="ApplicationInsightsWebTracking" /><add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" /></modules><validation validateIntegratedModeConfiguration="false" /></system.webServer><runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" /><bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /></dependentAssembly></assemblyBinding></runtime><system.codedom><compilers><compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" /><compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" /></compilers></system.codedom></configuration>


SITE MAP

<?xml version="1.0" encoding="utf-8" ?><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" ><siteMapNode url="~/Default.aspx" title="Home Page" description="Home Page" roles="*" ><siteMapNode url="~/PAGE.aspx" title="PAGE" description="PAGE"  roles="Admin" /><siteMapNode url="~/PAGE2.aspx" title="PAGE2" description="PAGE2" roles="Admin" /><siteMapNode url="~/PAGE3.aspx" title="PAGE3" description="PAGE3" roles="Admin,Supervise" /><siteMapNode url="~/PAGE4.aspx" title="PAGE4" description="PAGE4" roles="*" /><siteMapNode url="~/PAGE5.aspx" title="PAGE5" description="PAGE5" roles="Admin" /><siteMapNode url="~/PAGE6.aspx" title="PAGE6" description="PAGE6" roles="*" /><siteMapNode url="~/PAGE7.aspx" title="PAGE7" description="PAGE7" roles="*" /></siteMapNode></siteMap>


Viewing all articles
Browse latest Browse all 4737

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>