开发者

Using UmbracoMembershipProvider into an ASP.NET MVC Website

开发者 https://www.devze.com 2023-04-05 09:49 出处:网络
I am having problems using UmbracoMembershipProvider into another site. We have a project that contains an Umbraco website and a ASP.NET MVC 3 website for the main application.

I am having problems using UmbracoMembershipProvider into another site.

We have a project that contains an Umbraco website and a ASP.NET MVC 3 website for the main application.

We need to use the UmbracoMembershipProvider in the MVC application because we want to use the same admins in both Umbraco and our custom application.

So we have http://website.com (Umbraco) and http://website.com/app (Custom ASP.NET MVC 3)

I added this in our MVC app web.config:

<add name="UmbracoMembershipProvider" 
       type="umbraco.providers.members.UmbracoMembershipProvider, umbraco.providers" 
       enablePasswordRetrieval="false" 
       enablePasswordReset="false" 
       requiresQuesti开发者_StackOverflow中文版onAndAnswer="false"
       defaultMemberTypeAlias="Another Type" 
       passwordFormat="Hashed" />

<add name="UsersMembershipProvider" 
       type="umbraco.providers.UsersMembershipProvider, umbraco.providers" 
       enablePasswordRetrieval="false" 
       enablePasswordReset="false" 
       requiresQuestionAndAnswer="false" 
       passwordFormat="Hashed"  />

I also added this in the appSettings:

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

I have the same configuration in the Umbraco web.config

When I call the following method:

Membership.Providers["UsersMembershipProvider"].ValidateUser(username, password)

My IIS crashes and I get a StackOverflowException.

Did anyone have been able to connect an external application to the UmbracoMembershipService?


Ok, I figured it out.

In my MVC website, I add to create config folder and copy the umbracoSettings.config file in it.

So my folder tree looks like this:

  • MVCApp
    • config/umbracoSettings.config
  • Umbraco
    • config/umbracoSettings.config

I don't understand why I was having a stackoverflowexception, but this seems to solve my issue.


I was able to get my site working with a blank umbracoSettings.config file..

0

精彩评论

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

关注公众号