Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Schiavini 1 post 21 karma points
    Jul 12, 2012 @ 12:04
    Schiavini
    0

    Using the membership provider in a subapplication

    Hello,

    The requirements of our customer state that we need an application that runs separatedly from Umbraco (in MVC), but that can be reached from inside Umbraco without the need to logging in again.

    What I did is that I created an application in IIS in a subdirectory of Umbraco, and added a new section in Umbraco that sends the user to that directory.

    Now I need to find a way to check if the user is logged in or not, and if he has access to the new section. I tried to add references to the necessary DLLs and to change the membership/role providers in the MVC web.config:

         <!-- Membership Provider -->
          <membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
              <providers>
                  <clear />
                  <add name="UmbracoMembershipProvider" type="umbraco.providers.members.UmbracoMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Another Type" passwordFormat="Hashed" />
                  <add name="UsersMembershipProvider" type="umbraco.providers.UsersMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
              </providers>
          </membership>
          <!-- added by NH to support membership providers in access layer -->
          <roleManager enabled="true" defaultProvider="UmbracoRoleProvider">
              <providers>
                  <clear />
                  <add name="UmbracoRoleProvider" type="umbraco.providers.members.UmbracoRoleProvider" />
              </providers>
          </roleManager>
          

    I also added the database to the appSettings section:

         <add key="umbracoDbDSN" value="..." />

    However, the application is not able to authenticate any user. The [Authenticate] attribute is not able to authenticate anyone with the existing cookie, and the Membership.ValidateUser(user, pw) always returns false even if the password is correct.

    Am I on the correct way? Or should I do something totally different?

Please Sign in or register to post replies

Write your reply to:

Draft