/*
(non-Javadoc)

@see com.ibm.ws.webcontainer.security.JaspiService#logout(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, com.ibm.ws.webcontainer.security.WebAppSecurityConfig)
550990
@Override
    public void logout(HttpServletRequest req,
                       HttpServletResponse res,
                       WebAppSecurityConfig webAppSecConfig) throws AuthenticationException {
        Subject subject = null;
        WebRequest webRequest = new WebRequestImpl(req, res, null, null, null, null, webAppSecConfig);
        JaspiRequest jaspiRequest = new JaspiRequest(webRequest, null);
        AuthConfigProvider provider = getAuthConfigProvider(jaspiRequest.getAppContext());
        if (provider != null) {
            try {
                ServerAuthContext authContext = getServerAuthContext(jaspiRequest, provider);
                MessageInfo msgInfo = newMessageInfo(jaspiRequest);
                subject = getSubjectManager().getInvocationSubject();
                if (subject == null) {
                    subject = new Subject();
                }
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "cleanSubject with Jaspi", new Object[] { "authContext=" + authContext, msgInfo });
                authContext.cleanSubject(msgInfo, subject);
            } catch (AuthException e) {
                AuthenticationException ex = new AuthenticationException("JASPI cleanSubject failure: " + e);
                ex.initCause(e);
                throw ex;
            }
        }

        AuthenticationResult authResult = new AuthenticationResult(AuthResult.SUCCESS, subject);

        authResult.setAuditCredType(AuditEvent.CRED_TYPE_JASPIC);
        if (provider != null)
            authResult.setAuditAuthConfigProviderName(provider.getClass().toString());
        authResult.setAuditAuthConfigProviderAuthType(getRequestAuthType(jaspiRequest.getHttpServletRequest(), "AUTH_TYPE"));
        authResult.setAuditOutcome(AuditEvent.OUTCOME_SUCCESS);
        Audit.audit(Audit.EventID.SECURITY_API_AUTHN_TERMINATE_01, req, authResult, Integer.valueOf(res.getStatus()));

    }
180523
protected int logout(final Request request, final Response response)
    {
        // Clears the credentials
        request.setChallengeResponse(null);
        final CookieSetting credentialsCookie = this.getCredentialsCookie(request, response);
        credentialsCookie.setMaxAge(0);
        
        this.log.debug("calling attemptRedirect after logout");
        // Attempt to redirect
        this.attemptRedirect(request, response, null);
        
        return Filter.STOP;
    }
1276154
def logout(context, request):
    """"""

    @request.after
    def forget(response):
        request.app.forget_identity(response, request)

    return {
        'status': 'success'
    }
905212
def __Logout(si):
   
   try:
      if si:
         content = si.RetrieveContent()
         content.sessionManager.Logout()
   except Exception as e:
      pass
1207832
public function logout()
    {

        // load the authentication manager and try to authenticate this request
        /** @var \AppserverIo\Psr\Auth\AuthenticationManagerInterface $authenticationManager */
        if ($authenticationManager = $this->getAuthenticationManager()) {
            // try to load the authentication managers default authenticator
            if (($authenticator = $authenticationManager->getAuthenticator()) == null) {
                throw new ServletException('Can\'t find default authenticator');
            }

            // logout the actual user
            $authenticator->logout($this);
        }
    }
556759
private void cleanupLoggedOutToken(HttpServletRequest req, HttpServletResponse res) {
        AuthenticateApi aa = new AuthenticateApi(ssoCookieHelper, authenticationService);
        aa.simpleLogout(req, res);
    }
203591
public void logout(final BooleanCallback callback) {
		GwtCommand command = new GwtCommand(logoutCommandName);
		GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<SuccessCommandResponse>() {

			public void execute(SuccessCommandResponse response) {
				if (response.isSuccess()) {
					userToken = null;
					Authentication.this.userId = null;
					if (callback != null) {
						callback.execute(true);
					}
					GwtCommandDispatcher.getInstance().logout();
					manager.fireEvent(new LogoutSuccessEvent());
				} else {
					if (callback != null) {
						callback.execute(false);
					}
					manager.fireEvent(new LogoutFailureEvent());
				}
			}
		});
	}
1127548
public void logout() {
        saveResumeToken(null);
        mDDPState = DDPSTATE.NotLoggedIn;
        mUserId = null;
        broadcastConnectionState(mDDPState);
    }
903257
public void logout() throws IOException {

        String loggedInUserName = getRequestContext().getCurrentUser().getName();
        HttpSession session = getRequest().getSession(false);
        if (session != null) {
            session.invalidate();
            /* we need this because a new session might be created after this method,
             but before the session info is updated in OpenCmsCore.showResource. */
            getCmsObject().getRequestContext().setUpdateSessionEnabled(false);
        }
        // logout was successful
        if (LOG.isInfoEnabled()) {
            LOG.info(
                Messages.get().getBundle().key(
                    Messages.LOG_LOGOUT_SUCCESFUL_3,
                    loggedInUserName,
                    getRequestContext().addSiteRoot(getRequestContext().getUri()),
                    getRequestContext().getRemoteAddress()));
        }
        getResponse().sendRedirect(getFormLink());
    }
1195482
public void logout(Context context, ResponseListener listener){
        clearAuthorizationData();
        authorizationProcessManager.logout(context, listener);
    }
923723
def Logout(self, dumpXml=None):
		
		from UcsBase import UcsException

		if (self._cookie == None):
			return True

		if self._refreshTimer:
			self._refreshTimer.cancel()

		response = self.AaaLogout(dumpXml)
		self._cookie = None
		self._lastUpdateTime = str(time.asctime())
		self._domains = None
		self._priv = None
		self._sessionId = None
		self._version = None

		if self._ucs in defaultUcs:
			del defaultUcs[self._ucs]

		if (response.errorCode != 0):
			raise UcsException(response.errorCode, response.errorDescr)
		# raise Exception('[Error]: Logout [Code]:' + response.errorCode + '[Description]:' + response.errorDescr)

		return True
89808
protected void handleLogoutEvent(LogoutEvent event)
    {
        clearUser();
        Authentication auth = (Authentication) event.getSource();
        propertyChangeSupport.firePropertyChange(USER, auth, null);
    }
815807
@Nonnull
  public EChange logoutUser (@Nullable final String sUserID)
  {
    LoginInfo aInfo;
    m_aRWLock.writeLock ().lock ();
    try
    {
      aInfo = m_aLoggedInUsers.remove (sUserID);
      if (aInfo == null)
      {
        AuditHelper.onAuditExecuteSuccess ("logout", sUserID, "user-not-logged-in");
        return EChange.UNCHANGED;
      }

      // Ensure that the SessionUser is empty. This is only relevant if user is
      // manually logged out without destructing the underlying session
      final InternalSessionUserHolder aSUH = InternalSessionUserHolder._getInstanceIfInstantiatedInScope (aInfo.getSessionScope ());
      if (aSUH != null)
        aSUH._reset ();

      // Set logout time - in case somebody has a strong reference to the
      // LoginInfo object
      aInfo.setLogoutDTNow ();
    }
    finally
    {
      m_aRWLock.writeLock ().unlock ();
    }

    if (LOGGER.isInfoEnabled ())
      LOGGER.info ("Logged out " +
                   _getUserIDLogText (sUserID) +
                   " after " +
                   Duration.between (aInfo.getLoginDT (), aInfo.getLogoutDT ()).toString ());
    AuditHelper.onAuditExecuteSuccess ("logout", sUserID);

    // Execute callback as the very last action
    m_aUserLogoutCallbacks.forEach (aCB -> aCB.onUserLogout (aInfo));

    return EChange.CHANGED;
  }
1259555
def logout(self):
        ''''''
        headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain","User-Agent": user_agent}
        self.session.get('http://'+self.domain+'/logout.phtml',headers=headers)
1371645
@Subscribe
    public void onLogout(LogoutRequestEvent event) {
        Subject subject = ThreadContext.getSubject();
        if (subject != null) {
            subject.logout();
        }
    }
313101
public LogoutRequest newLogoutRequest(final String id, final DateTime issueInstant,
                                          final String destination, final Issuer issuer,
                                          final String sessionIndex, final NameID nameId) {
        val request = newSamlObject(LogoutRequest.class);
        request.setID(id);
        request.setVersion(SAMLVersion.VERSION_20);
        request.setIssueInstant(issueInstant);
        request.setIssuer(issuer);
        request.setDestination(destination);

        if (StringUtils.isNotBlank(sessionIndex)) {
            val sessionIdx = newSamlObject(SessionIndex.class);
            sessionIdx.setSessionIndex(sessionIndex);
            request.getSessionIndexes().add(sessionIdx);
        }

        if (nameId != null) {
            request.setNameID(nameId);
        }
        return request;
    }
430013
public function logout()
    {
        if ($this->isAuthenticated() !== true) {
            return;
        }
        $this->isAuthenticated = null;
        $session = $this->sessionManager->getCurrentSession();

        /** @var $token TokenInterface */
        foreach ($this->securityContext->getAuthenticationTokens() as $token) {
            $token->setAuthenticationStatus(TokenInterface::NO_CREDENTIALS_GIVEN);
        }
        $this->emitLoggedOut();
        if ($session->isStarted()) {
            $session->destroy('Logout through AuthenticationProviderManager');
        }
    }