Package org.eurekastreams.server.action.response.opensocial

Examples of org.eurekastreams.server.action.response.opensocial.SecurityTokenResponse


                oneOf(actionContext).getParams();
                will(returnValue("consumerKey"));
            }
        });
       
        SecurityTokenResponse results = sut.execute(actionContext);
       
        assertEquals(results.getSecurityToken().getContainer(), SECURITY_TOKEN_CONTAINER);
        assertEquals(results.getSecurityToken().getDomain(), SECURITY_TOKEN_DOMAIN);
        context.assertIsSatisfied();
    }
View Full Code Here


     *             on error.
     */
    @Test
    public void testGetSecurityTokenForConsumerRequest() throws Exception
    {
        final SecurityTokenResponse response = new SecurityTokenResponse(null);
        mockery.checking(new Expectations()
        {
            {
                oneOf(principalDao).execute(with(TEST_ARG1));
                will(returnValue(principal));
View Full Code Here

     *             thrown when the consumer key was not found.
     */
    public SecurityToken getSecurityTokenForConsumerRequest(final String consumerKey, final String userId)
            throws OAuthProblemException
    {
        SecurityTokenResponse response = null;
        try
        {
            // Currently, this supports two legged oauth with "reverse call home" where the server hosting an
            // application
            // wishes to request information about a user that has their application installed on their start page.
            ServiceActionContext currentContext = new ServiceActionContext(consumerKey, principalDao.execute(userId));
            response = (SecurityTokenResponse) actionController.execute(currentContext,
                    getSecurityTokenForConsumerRequestAction);
        }
        catch (Exception ex)
        {
            logger.error("Error occurred retrieving security token for Consumer Request.", ex);
            throw new OAuthProblemException("Error occurred retrieving security token for Consumer Request.");
        }
        return response != null ? response.getSecurityToken() : null;
    }
View Full Code Here

    {
        // TODO: put authorization in place to ensure this is a legit call. (i.e. supplied user has the supplied app
        // installed.)
        String userId = inActionContext.getPrincipal().getOpenSocialId();
        String consumerKey = (String) inActionContext.getParams();
        return new SecurityTokenResponse(new OAuthSecurityToken(userId, null, consumerKey, domain, container,
                null, AuthenticationMode.OAUTH_CONSUMER_REQUEST.name()));
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.action.response.opensocial.SecurityTokenResponse

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.