开发者

Create a brand new custom membership provider and authenticate from that

开发者 https://www.devze.com 2023-04-03 05:10 出处:网络
I have to develop a brand new custom membership provider(MyCustomProvider) in which i have to implement all the methods like validate user, CreateUser and all other and use this member开发者_运维问答s

I have to develop a brand new custom membership provider(MyCustomProvider) in which i have to implement all the methods like validate user, CreateUser and all other and use this member开发者_运维问答ship provider as authentication mechanism for my sharepoint site. I have implemented it completely. Now i am left with using it for authentication. I want to know how to proceed further.


After implementing your Provider you just set it up in the web.config:

<configuration>
  <system.web>
    <membership defaultProvider="MyCustomProvider" userIsOnlineTimeWindow="15">
      <providers>
        <clear/>
        <add name="MyCustomProvider" type="My.Namespace.MyCustomProvider" connectionStringName="myConnStr"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="MyApp" />
      </providers>
    </membership>      
   </system.web>
</configuration>

Then you can use Forms Authentication, Login Controls and all the other cool features.

Also check out this MSDN example for custom Membership Providers


I suggest you to read - Examining ASP.NET's Membership, Roles, and Profile

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号