Changes between Version 6 and Version 7 of WikiStart

Show
Ignore:
Timestamp:
01/27/14 11:55:44 (11 years ago)
Author:
smagi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v6 v7  
    161161Here we use the default ASP.NET session id which is stored in cookies to ensure that users can't inadvertently leak their private URL. 
    162162 
    163 == Page.OnPreInit == 
     163== {{{Page.OnPreInit}} == 
    164164 
    165 The last step is to add continuation validation at some point in the page lifecycle. Clavis checks that all the protected parameters hash to the same HMAC value as specified in the URL. If they don't, an exception was thrown indicating that a protected parameter was incorrectly changed. I typically do this in Page.OnPreInit: 
     165The last step is to add continuation validation at some point in the page lifecycle. Clavis checks that all the protected parameters hash to the same HMAC value as specified in the URL. If they don't, an exception was thrown indicating that a protected parameter was incorrectly changed. I typically do this in Page.OnPreInit in a custom System.Web.Page base class: 
    166166{{{ 
    167167protected override void OnPreInit(EventArgs e) 
     
    171171} 
    172172}}} 
     173As you can see, Clavis is a drop-in library that doesn't affect existing code. You can incrementally deploy it by converting one page at a time to continuations, and these pages will validate automatically as soon as they implement some IContinuation<...> type. You don't need to perform validation as above of course, you just need to place a call to {{{Continuation.Validate()}}} somewhere in the page lifecycle, although on init or pre-init is preferable so you don't waste time parsing parameters that won't validate anyway.