FormsAuthentication.Encrypt(ticket) returns null

Friday, December 5th, 2008

I’ve done a sample today and I need to create FormsAuthenticationTicket manually in order to make it inexpiable. I create specifying null for user data in the constructor.

1: FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, FormsAuthentication.FormsCookieName,
2: DateTime.Now, expiredTime, persist, null, FormsAuthentication.FormsCookiePath);
3: 
[...]

Access an web service from web application with different default credentials

Wednesday, December 3rd, 2008

Today, a developer from the team asked me how to access a web service in our domain with user default credentials but for different user that those in WindowsIdentity.GetCurrent().
Let’s say that there is a web site that is configured to use Windows authentication in ISS and in the web configuration file we have Windows authentication [...]