Package com.force.sdk.oauth.context

Examples of com.force.sdk.oauth.context.SecurityContext


    public void testRetrieveUserData() throws ConnectionException {
        UserDataRetriever dataRetriever = new ForceUserDataRetriever();
        dataRetriever.setStoreUsername(true);
        dataRetriever.setSessionId(VALID_SFDC_SID);
        dataRetriever.setEndpoint(VALID_SFDC_ENDPOINT);
        SecurityContext sc = dataRetriever.retrieveUserData();
       
        assertSecurityContextsAreEqual(partnerSc, sc,
                "retrieved security context is not equal to that which is returned by the mocked partner connector");
    }
View Full Code Here


    public void testRetrieveUserDataNoUsername() throws ConnectionException {
        UserDataRetriever dataRetriever = new ForceUserDataRetriever();
        dataRetriever.setStoreUsername(false);
        dataRetriever.setSessionId(VALID_SFDC_SID);
        dataRetriever.setEndpoint(VALID_SFDC_ENDPOINT);
        SecurityContext sc = dataRetriever.retrieveUserData();
       
        Assert.assertNull(sc.getUserName(), "username should be null when storeUsername is set to false");
        Assert.assertEquals(sc.getUserId(), partnerSc.getUserId(),
                "Security context should match that which the partner connection returned");
        Assert.assertEquals(sc.getSessionId(), partnerSc.getSessionId(),
                "Security context should match that which the partner connection returned");
        Assert.assertEquals(sc.getEndPoint(), partnerSc.getEndPoint(),
                "Security context should match that which the partner connection returned");
       
    }
View Full Code Here

     */
    @Override
    public SecurityContext retreiveSecurityContext(HttpServletRequest request)
            throws ContextStoreException {
        HttpSession session = request.getSession();
        SecurityContext sc =
            (SecurityContext) session.getAttribute(SECURITY_CONTEXT_SESSION_KEY);
        return sc;
    }
View Full Code Here

     */
    @Override
    public SecurityContext retrieveUserData(String sessionId, String endpoint, String refreshToken)
            throws ConnectionException {

        SecurityContext sc = super.retrieveUserData(sessionId, endpoint, refreshToken);

        customDataRetriever.setSessionId(sessionId);
        customDataRetriever.setEndpoint(endpoint);
        customDataRetriever.setRefreshToken(refreshToken);

View Full Code Here

@Service
public class PersonServiceImpl implements PersonService {
   
    private ForceApi getForceApi() {
        SecurityContext sc = ForceSecurityContextHolder.get();

        ApiSession s = new ApiSession();
        s.setAccessToken(sc.getSessionId());
        s.setApiEndpoint(sc.getEndPointHost());

        return new ForceApi(s);
    }
View Full Code Here

TOP

Related Classes of com.force.sdk.oauth.context.SecurityContext

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.