Trouble Authenticating User
I've been searching around the forums and the net for a way to essentially log in a user without having to enter the credentials in the log in page.
The setup we have is an existing site with our own users and roles and a separate Sitefinity web site. What I want to achieve is to seamlessly authenticate our existing users in Sitefinity.
So, I've implemented a service in the Sitefinity application that should log in the users. If they do not exist, I create a new one, settings the appropriate roles and then I try to authenticate the newly created user.
The users and roles are created and assigned as they should, but when authenticating the user, even when I get the UserLoggingReason.Success return code from the calls, that user is not logged in.
Calls to pages with specific view permissions set are "not served".
I looked at code posted in this post: http://www.sitefinity.com/devnet/forums/sitefinity-4-x/sdk/custom-authentication.aspx
and it looks like the code I wrote. What is it that I'm missing to make sure that the user is "really" logged in?
Do I need to call AuthenticateRequest? Do I need to set an authentication cookie?
I've also tried with calling the Users services, but to no avail.
Please help me.
Please check this forum post. If you use an older version of Sitefinity 4, please run a test using the latest version, because there are fixes related to the authentication.
the Telerik team
I tried that too, but I have some questions about the code below:
You can modify the code as below
// Invoke the method and return the response.
using (var response = (HttpWebResponse)request.GetResponse())
// Store the cookies from the response for the current session.
cookies = response.Cookies;
// Read the response
using (var reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
The empty strings are left for some tests and if you want to pass the cookies from another storage where you need to set name and value and return the correct response.
the Telerik team