Use Umbraco Membership Login authentication info to authenticate another project login

1k views Asked by At

I am new to Umbraco and find it very interesting, I have the problem below. Can anybody please help?

  1. I have Umbraco configured in one of my projects which is in MVC, which is working fine, in this project I have members created.

  2. I have another .NET Web Forms project, with login page, and other pages.

Now the question is, can I use the CMS Members from my 1st project, ie. Umbraco to authenticate the users login of second, ie. Web Formsproject. If yes, then how?

2

There are 2 answers

0
Crick3t On

We have done something similar just now. In our case we are migrating from one one CMS to another and as a first step we had to move the login handling to Umbraco.

After trying out multiple solutions the final one was to set up the Umbraco website on a sub domain as a completely separate site. Main website is on www.something.com and the Umbraco one is on umbraco.something.com.

Then we have created a new controller inheriting from UmbracoApiController and created methods to login, logout and to check if the user is logged in. All these methods are using the MembersMembershipProvider

After all this you can call these methods with RestSharp for example, from your other project.

To make this work it is important to use forms authentication, have the website on a sub domain AND to set the forms authentication domain correctly (see below).

<authentication mode="Forms">
    <forms name="UmbracoAuthCookie" protection="All" path="/" timeout="525000" loginUrl="login.aspx" cookieless="UseCookies" slidingExpiration="true" domain=".something.com"  />
</authentication>

This last part is important (domain=".something.com"), otherwise the Umbraco website cannot access the cookie from the subdomain. You can find out more about this here. The first dot is important, more information here (page 7).

I am not sure if this can be used in your case, but hope it helps to give you an option.

1
Anup Ksagar On

Thanks for answering. Solved the issue by creating a webservice which accepts username and password in umbraco project, while returning the status of login as output. this approach also helped in retreiving the setting of umbraco used to show and hide controls in new project.

Again Thanking you all for your support.