Crowbar.CrowbarViewContext.SetFormsAuthPrincipal C# (CSharp) Method

SetFormsAuthPrincipal() public method

Sets the security principal, using forms identity, in which the view should be rendered.
public SetFormsAuthPrincipal ( string username, int timeout = 30 ) : CrowbarViewContext
username string The username.
timeout int The time, in minutes, for which the forms authentication cookie is valid.
return CrowbarViewContext
        public CrowbarViewContext SetFormsAuthPrincipal(string username, int timeout = 30)
        {
            var ticket = new FormsAuthenticationTicket(username, false, timeout);
            User = new GenericPrincipal(new FormsIdentity(ticket), new string[0]);

            return this;
        }