Package com.force.sdk.connector

Examples of com.force.sdk.connector.ForceConnectorConfig


         * Initializes the thread to access the dynamically created test org.
         */
        private void loadThreadContext(UserInfo info) throws ConnectionException, IOException {
            Assert.assertNotNull(info, "UserInfo is not specified.");
            Assert.assertNotNull(info.getUserName(), "UserName is not specified.");
            ForceConnectorConfig cc = new ForceConnectorConfig();
            cc.setUsername(info.getUserName());
            cc.setPassword(info.getPassword());
            cc.setAuthEndpoint(info.getServerEndpoint());
            service = Connector.newConnection(cc);
            ForceServiceConnector.setThreadLocalConnectorConfig(cc); //required so that this thread uses dynamic org
        }
View Full Code Here


            username = uinfo.getUserName();
            password = uinfo.getPassword();
            authEndpoint = uinfo.getServerEndpoint();
        }
       
        ForceConnectorConfig conf = new ForceConnectorConfig();
        conf.setUsername(username);
        conf.setPassword(password);
        conf.setAuthEndpoint(authEndpoint);
        ForceServiceConnector conn = new ForceServiceConnector(conf);
        PartnerConnection service = conn.getConnection();
        return service;
    }
View Full Code Here

                    .getAttribute(SecurityContextSessionStore.SECURITY_CONTEXT_SESSION_KEY);
            SecurityContext verificationSc = (SecurityContext) reqSession.getAttribute(SECURITY_CONTEXT_TO_VERIFY_KEY);

            Assert.assertNotNull(sc, "The security context in the session should not be null");
            assertSecurityContextsAreEqual(verificationSc, sc, "Security contexts are not equal");
            ForceConnectorConfig connectorConfig = ForceServiceConnector.getThreadLocalConnectorConfig();

            Assert.assertNotNull(connectorConfig,
                    "The ForceConnectorConfig stored in the thread local should not be null when a user has logged in");
            Assert.assertTrue(connectorConfig.getSessionRenewer() instanceof AuthFilter,
                    "An AuthFilter should be the session renewer.");
            Assert.assertEquals(connectorConfig.getSessionId(), verificationSc.getSessionId(),
                    "Session id in the security context should match that in the connector config.");
            Assert.assertEquals(connectorConfig.getServiceEndpoint(), verificationSc.getEndPoint(),
                    "Endpoint in the security context should match that in the connector config.");
        }
View Full Code Here

           
            verifySecurityContext(sc, true /* checkApiEndpoint*/);
        }
       
        private String getExpectedUserRole() throws IOException {
            ForceConnectorConfig config = new ForceConnectorConfig();
            config.setAuthEndpoint(userInfo.getServerEndpoint());
            config.setUsername(userInfo.getUserName());
            config.setPassword(userInfo.getPassword());
            String userRole = null;
           
            try {
                ForceServiceConnector forceConn = new ForceServiceConnector(config);
                PartnerConnection partnerConn = forceConn.getConnection();
View Full Code Here

     */
    private static class VerificationFilterChain implements FilterChain {

        @Override
        public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException {
            ForceConnectorConfig connConfig = ForceServiceConnector.getThreadLocalConnectorConfig();

            Assert.assertEquals(
                    SESSION_ID,
                    connConfig.getSessionId(),
                    "Session id stored in ForceConnectorConfig thread local should equal that "
                    + "which was in session prior to calling the ForceConnectionStorageFilter");
            Assert.assertEquals(
                    ENDPOINT,
                    connConfig.getServiceEndpoint(),
                    "Service endpoing stored in ForceConnectorConfig thread local should equal that "
                    + "which was in session prior to calling the ForceConnectionStorageFilter");
            Assert.assertTrue(connConfig.getSessionRenewer() instanceof ForceConnectionStorageFilter,
                    "Session renewer should be a ForceConnectionStorageFilter.");

            SecurityContext sc = ForceSecurityContextHolder.get();

            Assert.assertEquals(
View Full Code Here

TOP

Related Classes of com.force.sdk.connector.ForceConnectorConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.