Package com.force.sdk.oauth.userdata

Examples of com.force.sdk.oauth.userdata.UserDataRetrievalService


     * Default constructor. Sets OAuth version to 2.0. Uses standard
     * data retrieval service.
     */
    public ForceOAuthConnector() {
        this.version = OAuthVersion.VERSION_2_0;
        this.userDataRetrievalService = new UserDataRetrievalService();
        this.tokenRetrievalService = new TokenRetrievalServiceImpl();
    }
View Full Code Here


        ForceOAuthConnectionInfo connInfo = new ForceOAuthConnectionInfo();
        connInfo.setEndpoint(endpoint);
        connInfo.setOauthKey(oauthKey);
        connInfo.setOauthSecret(oauthSecret);
       
        ForceOAuthConnector connector = new ForceOAuthConnector(new UserDataRetrievalService(true));
        connector.setConnectionInfo(connInfo);

        //add a bad connection in. The values above should take precedence.
        System.setProperty("force.testExternalConnInfoBeforeConnNameLookup.url",
            "force://url?oauth_key=ABCDEF&oauth_secret=123456");
View Full Code Here

        "Security context should match that which the partner api returned");
    }
   
    @Test
    public void testConnectorWithEnvVariable() throws Exception {
        ForceOAuthConnector connector = new ForceOAuthConnector(new UserDataRetrievalService(true));
        connector.setConnectionName("CONNURLENVVAR"); // FORCE_CONNURLENVVAR_URL is set in pom file
        connector.setTokenRetrievalService(
                new MockTokenRetrievalService(
                        partnerSc.getEndPoint(), partnerSc.getSessionId(),
                        VALID_SFDC_INSTANCEURL, partnerSc.getRefreshToken(), oauthKey, oauthSecret));
View Full Code Here

        assertSecurityContextsAreEqual(partnerSc, connector.refreshAccessToken(REFRESH_TOKEN),
            "Security context should match that which the partner api returned");    }
   
    @Test
    public void testConnectorWithJavaProperty() throws Exception {
        ForceOAuthConnector connector = new ForceOAuthConnector(new UserDataRetrievalService(true));
        try {
            System.setProperty("force.connUrlJavaProperty.url", createConnectionUrl());
            connector.setConnectionName("connUrlJavaProperty");
            connector.setTokenRetrievalService(
                    new MockTokenRetrievalService(
View Full Code Here

        }
    }
   
    @Test
    public void testConnectorWithOAuthInfoPropertyFile() throws Exception {
        ForceOAuthConnector connector = new ForceOAuthConnector(new UserDataRetrievalService(true));
        connector.setConnectionName("funcconnoauthinfo"); // funcconnoauthinfo.properties defined in /src/test/resources
        connector.setTokenRetrievalService(
                new MockTokenRetrievalService(
                        partnerSc.getEndPoint(), partnerSc.getSessionId(),
                        VALID_SFDC_INSTANCEURL, partnerSc.getRefreshToken(), oauthKey, oauthSecret));
View Full Code Here

        assertSecurityContextsAreEqual(partnerSc, connector.refreshAccessToken(REFRESH_TOKEN),
            "Security context should match that which the partner api returned");    }
   
    @Test
    public void testConnectorWithConnUrlPropertyFile() throws Exception {
        ForceOAuthConnector connector = new ForceOAuthConnector(new UserDataRetrievalService(true));
        connector.setConnectionName("funcconnurl"); // funcconnoauthinfo.properties defined in /src/test/resources
        connector.setTokenRetrievalService(
                new MockTokenRetrievalService(
                        partnerSc.getEndPoint(), partnerSc.getSessionId(),
                        VALID_SFDC_INSTANCEURL, partnerSc.getRefreshToken(), oauthKey, oauthSecret));
View Full Code Here

   
    private ForceOAuthConnector createConnector() {
        ForceOAuthConnectionInfo connInfo = new ForceOAuthConnectionInfo();
        connInfo.setConnectionUrl(createConnectionUrl());
       
        ForceOAuthConnector connector = new ForceOAuthConnector(new UserDataRetrievalService(true));
        connector.setConnectionInfo(connInfo);
        connector.setTokenRetrievalService(new MockTokenRetrievalService(
                partnerSc.getEndPoint(), partnerSc.getSessionId(),
                VALID_SFDC_INSTANCEURL, partnerSc.getRefreshToken(), oauthKey, oauthSecret));
        return connector;
View Full Code Here

        assertTrue(context.containsBean("connectionStorageFilter"),
                    "Could not find connectionStorageFilter bean after parsing " + configLocation);

        ForceOAuthConnectionInfo connInfo = context.getBean("oauthConnectionInfo", ForceOAuthConnectionInfo.class);
        ForceOAuthConnector connector = context.getBean("oauthConnector", ForceOAuthConnector.class);
        UserDataRetrievalService userDataRetrievalService =
            context.getBean("userDataRetrievalService", UserDataRetrievalService.class);

        assertTrue(userDataRetrievalService.isStoreUsername(),
                "store-user-name was set to true so the storeUsername value "
                    + "on the user data retrieval service should be true");
        validateConnectionInfo(connInfo, "Parsing " + configLocation + ", checking ForceOAuthConnectionInfo");

        ForceOAuthConnectionInfo connInfoOnConnector = invoke(connector, "getConnInfo");
View Full Code Here

                    "Could not find rememberMeFilter bean after parsing " + configLocation);
        assertTrue(context.containsBean("connectionStorageFilter"),
                    "Could not find connectionStorageFilter bean after parsing " + configLocation);
       
        ForceOAuthConnector connector = context.getBean("oauthConnector", ForceOAuthConnector.class);
        UserDataRetrievalService userDataRetrievalService =
            context.getBean("userDataRetrievalService", UserDataRetrievalService.class);
       
        assertTrue(userDataRetrievalService.isStoreUsername(),
                    "store-user-name not set so the storeUsername value "
                        + "on the user data retrieval service should default to true");
        // For expected values, see security-config-ns-connName.xml
        // connector property is loaded through a non-public getter
        assertEquals(invoke(connector, "getConnectionName"), "connName",
View Full Code Here

                    "Could not find forceRememberMeServices bean after parsing " + configLocation);
        assertTrue(context.containsBean("rememberMeFilter"),
                    "Could not find rememberMeFilter bean after parsing " + configLocation);
        assertTrue(context.containsBean("connectionStorageFilter"),
                    "Could not find connectionStorageFilter bean after parsing " + configLocation);
        UserDataRetrievalService userDataRetrievalService =
            context.getBean("userDataRetrievalService", UserDataRetrievalService.class);
       
        Assert.assertFalse(userDataRetrievalService.isStoreUsername(),
                    "store-user-name was set to false so the storeUsername value "
                        + "on the user data retrieval service should be false");
        ForceOAuthConnector connector = context.getBean("oauthConnector", ForceOAuthConnector.class);
       
        ForceConnectionStorageFilter connStorageFilter = context.getBean(ForceConnectionStorageFilter.class);
View Full Code Here

TOP

Related Classes of com.force.sdk.oauth.userdata.UserDataRetrievalService

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.