March 24, 2010

Windows and Forms Authentication

1. Create or Extend a Web Application.
2. Deployed CKS.FBA for Forms Based Authentication.
3. Modified Parser Paths in Web.Config if any of the master page has c# code in it.
<PageParserPaths>
<PageParserPath VirtualPath="/_catalogs/masterpage/Home.master" CompilationMode="Always" AllowServerSideScript="true">
</PageParserPath>
<PageParserPath VirtualPath="/_catalogs/masterpage/Home_Template.master" CompilationMode="Always" AllowServerSideScript="true">
</PageParserPath>
<PageParserPath VirtualPath="/_catalogs/masterpage/InnerPage.master" CompilationMode="Always" AllowServerSideScript="true">
</PageParserPath>
</PageParserPaths>
4. Added Safe Controls
5. Browse to C:\Windows\Microsoft.NET\Framework64\v2.0.50727
6. Run Aspnet_regsql.exe and create a database for Membership Provider.
7. Add Membership Provider information in web.config along with the Connection String
<connectionStrings>
<add name="FBAConnectionString" connectionString="Data Source=DBServerName ;Initial Catalog=DBName;Integrated Security=True" />
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<!-- membership provider -->
<membership defaultProvider="FBAMember">
<providers>
<add connectionStringName="FBAConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" name="FBAMember" type="System.Web.Security.SqlMembershipProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
<!-- role provider -->
<roleManager enabled="true" defaultProvider="FBARole">
<providers>
<add connectionStringName="FBAConnectionString" applicationName="/" name="FBARole" type="System.Web.Security.SqlRoleProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
<securityPolicy>
Note: All the web.config changes are needed to restore an already application, otherwise no touching on Web.Config needed other than Membership Provider.
8. Extend the Application
9. Authentication Provider, Set to Forms and Give the Name of the Provider which you mentioned in Web.config
10.All Membership additions in web.config should also be added in central admin Port also.
11. Add Users in Extended Application through IIS, .Net Users.
12. In Central Admin, Keep one FBA User as Collection Adminisatrtor (Important)
13. Now Have Fun with Windows and Forms
14. Error: Unknown Error mostly is because the secondary site collection adminsiatrtor is not set with fba user., add it in central admin and you will be fine.

No comments:

SonarQube with Jenkins Setup using Docker Images

https://funnelgarden.com/sonarqube-jenkins-docker/  https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-con...