Пример #1
0
        protected override void OnLoad(EventArgs e)
        {
            string action = this.Request.QueryString[WSFederationConstants.Parameters.Action];

            if (action == WSFederationConstants.Actions.SignOut || action == WSFederationConstants.Actions.SignOutCleanup)
            {
                // Process signout request.
                SimulatedWindowsAuthenticationOperations.LogOutUser(this.Request, this.Response);
                WSFederationMessage requestMessage = WSFederationMessage.CreateFromUri(this.Request.Url);
                FederatedPassiveSecurityTokenServiceOperations.ProcessSignOutRequest(requestMessage, this.User, null, this.Response);
                this.ActionExplanationLabel.Text = @"Sign out from the issuer has been requested.";

                this.SignOutRelyingParties();

                SingleSignOnManager.Clear();
            }
            else
            {
                throw new InvalidOperationException(
                          String.Format(
                              CultureInfo.InvariantCulture,
                              "The action '{0}' (Request.QueryString['{1}']) is unexpected. Expected actions are: '{2}' or '{3}'.",
                              String.IsNullOrEmpty(action) ? "<EMPTY>" : action,
                              WSFederationConstants.Parameters.Action,
                              WSFederationConstants.Actions.SignIn,
                              WSFederationConstants.Actions.SignOut));
            }

            base.OnLoad(e);
        }