Modified to prevent blank page on authentication failure, redirects to restart.aspx instead.
Better logging
Defaults to PUBLIC mode if the Mode Variable is missing.
Modified to prevent "Error: Object reference not set to an instance of an object" if UserID or Mode variables are not supplied, e.g. like hitting the Begin site without making a Forms Post as happens when a user browses directly to the realm/SecureAuth.aspx which then redirects the user to the Begin site.  Now if that happens the user will be redirected to restart.aspx
Missing SharedSecret (If required in the workflow tab) or missing password (again if required in the workflow tab) will still trigger Error: Object reference not set to an instance of an object
