R
ryan_fagan
MSDN has good articles that explains how to use GenericPrincipal
objects with forms authentication. For instance,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT04.asp
However, in each of the examples I have seen, they do not use the
values that are specified in the web.config for forms authentication.
For instance the code below creates the cookie with an expiration of
60. I want to use the value in the web.config as configured in
FormsAuthentication. However, this information is not exposed by the
System.Web.Configuration objects or the FormsAuthentication objects.
Does anyone know a good way to access that data?
// Create the authentication ticket
FormsAuthenticationTicket authTicket = new
FormsAuthenticationTicket(
1, // version
txtUserName.Text, // user name
DateTime.Now, // creation
DateTime.Now.AddMinutes(60),// Expiration
false, // Persistent
roles ); // User data
objects with forms authentication. For instance,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT04.asp
However, in each of the examples I have seen, they do not use the
values that are specified in the web.config for forms authentication.
For instance the code below creates the cookie with an expiration of
60. I want to use the value in the web.config as configured in
FormsAuthentication. However, this information is not exposed by the
System.Web.Configuration objects or the FormsAuthentication objects.
Does anyone know a good way to access that data?
// Create the authentication ticket
FormsAuthenticationTicket authTicket = new
FormsAuthenticationTicket(
1, // version
txtUserName.Text, // user name
DateTime.Now, // creation
DateTime.Now.AddMinutes(60),// Expiration
false, // Persistent
roles ); // User data