The following problem has been a brick wall for us for a couple of weeks
now. Telerik are trying to help, but I am hoping to expedite things by
We have some code that programmatically authenticates a user:
protected void Page_Load(object sender, EventArgs e)
UserManager manager = UserManager.GetManager();
var objUser = manager.GetUser("theuser"); //Curious -objUser never gets used?
var validate = SecurityManager.AuthenticateUser(UserManager.GetDefaultProviderName(), "theuser", "password", true);
bool authenticated = validate == UserLoggingReason.Success;
manager.Provider.SuppressSecurityChecks = true;
//Set Auth. cookie per suggestion from Telerik
Trace.Write("Page_Load: authenticated: " + authenticated);
Trace.Write("Page_Load: User.Identity.Name: " + User.Identity.Name);
if (Request["returnUrl"] == null)
Response.Write("authenticated: " + authenticated.ToString());
When I run this, "validate" has the value UserLoggingReason.Success, so
the user is successfully authenticated. After this, the user is redirected
to the site's home page: ~/Home.
Problem: When the page loads it shows a 403 error:
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden.
Please review the URL below and make sure that it is spelled correctly.
Requested URL: /sites/demo/Home
The user was created in Sitefinity using the CMS and is assigned to the Role "Users".
The site has permissions for all pages set to:
View pages (?): Users
The Page /Home, inherits permissions from all pages.
The root of the sitefinity application is in /sites.
It would appear that the user does not have permission to view the page.
However, if I log in with the account through the sitefinity CMS interface, and
navigate to Home.aspx, I can view it fine.
Why can't the logged in user see the page when viewing via a redirection
after being logged in programmatically?