Changes on the authentication service

Now that the 3.5 version of the platform is out, it”s time to start digging in with Reflector. Since I was experimenting with the authentication service to try to answer a question that was posted on the forums, I couldn”t stop noticing that on ASP.NET 3.5 the AuthenticationService is now… a WCF service. Besides that, there are also some other cool things:

This server class has a two static events: Authenticating and CreatingCookie;

  • The first event (Authenticating) is generated during the authentication operation, giving you a chance to perform the authentication yourself (if you do authenticate the user during that event, don”t forget to set the AuthenticationIsComplete property of the AuthenticatingEventArgs class that is passed as the EventArgs parameter to the method that is handling the event);
  • The CreatingCookie event is fired when you choose to create a cookie (ie, when you pass true to the client createPersistentCookie – hope I didn”t mess up the name of the parameter that the client login method expects šŸ™‚ ,,). This means that now you can create your own cookie instead of getting the default cookie. As expected, there is a custom property (CookieIsSet)  on the custom EventArgs object (CreatingCookieEventArgs) that gets passed into the  method that handles the event which lets you say if you want the default cookie (or not). Do notice that if you don”t handle the event (or don”t set the CookieIsSet property) you”ll end up getting the default ASP.NET authentication cookie.

So, it seems that there are some new things on the ASP.NET AJAX platform…I”ll try to come back with some posts on the next days…

Advertisements

~ by Luis Abreu on November 25, 2007.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: