Silently authenticates the user by using cached credentials.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
When you use forms authentication to validate the current user, the ClientFormsIdentity class stores the user credentials as long as the application is running. However, the user is only authenticated until the authentication cookie expires. After the cookie expires, the user must be revalidated to access the remote roles or Web settings services. You can use the Advanced Settings for Services dialog box to configure your application to automatically revalidate the user, as described in How to: Configure Client Application Services. However, if you configure your application to honor the cookie expiration, you can programmatically revalidate the user by calling the method. This method is also useful when switching from offline mode to online mode, because the application may have been shut down while offline.
The method is for convenience only. Because it does not have a return value, it cannot indicate whether revalidation has failed. Revalidation can fail, for example, if the user credentials have changed on the server. In this case, you might want to include code that explicitly validates users after a service call fails. For more information, see the Accessing Web Settings section in Walkthrough: Using Client Application Services.
The following example code demonstrates how to use this method to silently revalidate a user when the application leaves the offline state. In this example, a CheckedChanged event handler updates the offline status to match the check box value. If the user sets the application to the online state, the event handler attempts to revalidate the user. However, if the authentication server is unavailable, the event handler returns the application to the offline state.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.