YAFLogo

Daeamon Dmitry
7 years ago
Hi, i'm trying to integrate YafMembershipProvider with my application, but this does'not work((((

I'm add to references dll's from YAFNet and edit my web.config.


<membership defaultProvider="YafMembershipProvider" hashAlgorithmType="SHA1">
      <providers>
        <clear />
        <!-- YAF's ASP.NET Membership Provider is designed to work a bit better with YAF.NET options, but is by no means required.
             But, you will not be able to switch providers after installing your forum. -->
        <add name="YafMembershipProvider" applicationName="OlenObl" connectionStringName="DefaultConnection"
             requiresUniqueEmail="true" useSalt="true" type="YAF.Providers.Membership.YafMembershipProvider" />

        <!-- Uncomment and set as default if you want to use the built-in ASP.NET membership provider. Password Type of "Encrypted" requires a machine key. -->
        <!-- If you want to install YAF.NET inside Azure you need to use that Provider. -->
        <!--<add name="AspNetSqlMembershipProvider" applicationName="YetAnotherForum" connectionStringName="yafnet"
             enablePasswordReset="false" enablePasswordRetrieval="true" maxInvalidPasswordAttempts="5"
             minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="5" passwordAttemptWindow="15"
             passwordFormat="Encrypted" requiresQuestionAndAnswer="false" requiresUniqueEmail="true"
             type="System.Web.Security.SqlMembershipProvider" />-->
      </providers>
    </membership>

    <roleManager enabled="true" defaultProvider="YafRoleProvider">
      <providers>
        <clear />
        <!-- YAF's ASP.NET Role Provider is designed to work a bit better with YAF.NET options, but is by no means required.
             But, you will not be able to switch providers after installing your forum. -->
        <add name="YafRoleProvider" applicationName="OlenObl" connectionStringName="DefaultConnection"
                     type="YAF.Providers.Roles.YafRoleProvider" />
        <!-- Uncomment and set as default if you want to use use the built-in ASP.NET role provider. -->
        <!--<add name="AspNetSqlRoleProvider" applicationName="YetAnotherForum" connectionStringName="yafnet"
                     type="System.Web.Security.SqlRoleProvider" />-->
      </providers>
    </roleManager>

    <profile enabled="true" defaultProvider="YafProfileProvider" inherits="YAF.Utils.YafUserProfile">
      <providers>
        <clear />
        <!-- YAF's ASP.NET Profile Provider is designed to work a bit better with YAF.NET options, but is by no means required.
             But, you will not be able to switch providers after installing your forum. -->
        <add name="YafProfileProvider" applicationName="OlenObl" connectionStringName="DefaultConnection"
             type="YAF.Providers.Profile.YafProfileProvider" />
        <!-- Uncomment and set as default if you want to use use the built-in ASP.NET profile provider. -->
        <!--<add name="AspNetSqlProfileProvider" applicationName="YetAnotherForum" connectionStringName="yafnet"
                     type="System.Web.Profile.SqlProfileProvider" />-->
      </providers>
    </profile>

I get authorization error.

 Screenshot_4.png You have insufficient rights to see the content.

How do I change the AccountController.cs so that it all works?

Anyone help me?)

Maybe any one already has worked AccountController.cs for ะก# ASP.NET Mvc 4?

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
7 years ago
No that wont work directly you can not integrate yaf inside a MVC Applictation. The only solution would be to run YAF as separate application.