SecurityContext sc = (SecurityContext) auth.getDetails(); cc.setServiceEndpoint(sc.getEndPoint()); cc.setSessionRenewer(this);
private void initConfig() { if (config.getSessionRenewer() == null) { config.setSessionRenewer(this); } // Add proxy information to config if (DEFAULT_PROXY != null && (config.getProxy() != Proxy.NO_PROXY || config.getProxy().type() == Type.DIRECT)) { config.setProxy(DEFAULT_PROXY); } // Transfer any extra state we have to config if (this.timeout > 0) config.setReadTimeout(this.timeout); }
private void initConfig() { if (config.getSessionRenewer() == null) { config.setSessionRenewer(this); } // Add proxy information to config if (DEFAULT_PROXY != null && (config.getProxy() != Proxy.NO_PROXY || config.getProxy().type() == Type.DIRECT)) { config.setProxy(DEFAULT_PROXY); } // Transfer any extra state we have to config if (this.timeout > 0) config.setReadTimeout(this.timeout); }
config.setServiceEndpoint(sc.getEndPoint()); config.setSessionId(sc.getSessionId()); config.setSessionRenewer(this); ForceServiceConnector connector = new ForceServiceConnector(); connector.setConnectorConfig(config);
config.setServiceEndpoint(sc.getEndPoint()); config.setSessionId(sc.getSessionId()); config.setSessionRenewer(this); ForceServiceConnector connector = new ForceServiceConnector(); connector.setConnectorConfig(config);
cc.setSessionId(sc.getSessionId()); cc.setServiceEndpoint(sc.getEndPoint()); cc.setSessionRenewer(this);
cc.setSessionId(sc.getSessionId()); cc.setServiceEndpoint(sc.getEndPoint()); cc.setSessionRenewer(this);
@Override public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { if (authentication == null || authentication.getDetails() == null || !(authentication.getDetails() instanceof SecurityContext)) return; ForceConnectorConfig config = new ForceConnectorConfig(); try { SecurityContext sc = ((SecurityContext) authentication.getDetails()); // Use the value from session and not the login endpoint request.setAttribute(LogoutSuccessHandler.FORCE_ENDPOINT_ATTRIBUTE, sc.getEndPoint()); config.setServiceEndpoint(sc.getEndPoint()); config.setSessionId(sc.getSessionId()); config.setSessionRenewer(this); ForceServiceConnector connector = new ForceServiceConnector(); connector.setConnectorConfig(config); //logout from the partner API connector.getConnection().logout(); } catch (ConnectionException e) { if (config.getSessionId() != null) { // If the session id is null that means we visited the renewer method below and the session is dead anyways throw new AuthenticationServiceException("Unable to logout from Salesforce", e); } } }