Package org.eurekastreams.server.domain

Examples of org.eurekastreams.server.domain.OAuthConsumer


                oneOf(securityToken).getOwnerId();
                will(returnValue("456"));

                oneOf(consumerMapper).execute(with(any(OAuthConsumerRequest.class)));
                will(returnValue(new OAuthConsumer("", "", "", "", "")));

                oneOf(tokenMapper).execute(with(any(OAuthTokenRequest.class)));
                will(returnValue(null));
            }
        });
View Full Code Here


            {
                oneOf(actionContext).getParams();
                will(returnValue(new GetConsumerTokenInfoRequest(securityToken, consumerInfo, "serviceName",
                        "tokenName")));

                OAuthConsumer consumer = new OAuthConsumer("", "", "", "", "");
                OAuthToken token = new OAuthToken(consumer, "", "", "", "");
                token.setTokenExpireMillis(0L);

                oneOf(securityToken).getAppUrl();
                will(returnValue("http://localhost:4040/some/path"));

                oneOf(securityToken).getViewerId();
                will(returnValue("123"));

                oneOf(securityToken).getOwnerId();
                will(returnValue("456"));

                oneOf(consumerMapper).execute(with(any(OAuthConsumerRequest.class)));
                will(returnValue(new OAuthConsumer("", "", "", "", "")));

                oneOf(tokenMapper).execute(with(any(OAuthTokenRequest.class)));
                will(returnValue(token));
            }
        });
View Full Code Here

            {
                oneOf(actionContext).getParams();
                will(returnValue(new RemoveConsumerTokenRequest(securityToken, consumerInfo, "serviceName", // \n
                        "tokenName")));

                OAuthConsumer consumer = new OAuthConsumer("", "", "", "", "");
                OAuthToken token = new OAuthToken(consumer, "", "", "", "");
                token.setTokenExpireMillis(0L);

                oneOf(securityToken).getAppUrl();
                will(returnValue("http://localhost:4040/some/path"));

                oneOf(securityToken).getViewerId();
                will(returnValue("123"));

                oneOf(securityToken).getOwnerId();
                will(returnValue("456"));

                oneOf(consumerMapper).execute(with(any(OAuthConsumerRequest.class)));
                will(returnValue(new OAuthConsumer("", "", "", "", "")));

                oneOf(tokenDeleteMapper).execute(with(any(OAuthTokenRequest.class)));
            }
        });
View Full Code Here

                oneOf(securityToken).getAppUrl();
                will(returnValue("http://localhost:4040/some/path"));

                oneOf(consumerMapper).execute(with(any(OAuthConsumerRequest.class)));
                will(returnValue(new OAuthConsumer("", "", "", "", "")));
            }
        });
        ConsumerInfoResponse response = (ConsumerInfoResponse) sut.execute(actionContext);
        Assert.assertNotNull("Consumer was not found", response.getConsumerInfo());
        context.assertIsSatisfied();
View Full Code Here

        dto.setAuthorized(true);
        dto.setCallbackToken("callbacktoken");
        dto.setCallbackTokenAttempts(0);
        dto.setCallbackUrl("callbackurl");
        dto.setCallbackUrlSigned(true);
        dto.setConsumer(new OAuthConsumer(null, null, "key", null, null));
        dto.setContainer("container");
        dto.setDomain("domain");
        dto.setIssueTime(new Date());
        dto.setOauthVersion("1.0");
        dto.setToken("token");
View Full Code Here

       
        context.checking(new Expectations()
        {
            {
                oneOf(mapper).execute("testkey");
                will(returnValue(new OAuthConsumer(null, null, "testkey", null, null)));
            }
        });

        OAuthDomainEntry dto = sut.convertToEntryDTO(entry);
        assertEquals(entry.getAppId(), dto.getAppId());
View Full Code Here

     * Test grabbing the consumer key.
     */
    @Test
    public void testSuccessfulConsumerKey()
    {
        final OAuthConsumer consumer = new OAuthConsumer("testprovider", "gadgeturl", TEST_CONSUMER_KEY, "secret",
                "HMAC-SHA1");
       
        context.checking(new Expectations()
        {
            {
View Full Code Here

                oneOf(securityToken).getAppUrl();
                will(returnValue("http://localhost:4040/some/path"));

                oneOf(consumerMapper).execute(with(any(OAuthConsumerRequest.class)));
                will(returnValue(new OAuthConsumer("", "", "", "", "")));

                OAuthConsumer consumer = new OAuthConsumer("", "", "", "", "");
                OAuthToken token = new OAuthToken(consumer, "", "", "", "");
                token.setTokenExpireMillis(0L);

                oneOf(securityToken).getViewerId();
                will(returnValue("123"));
View Full Code Here

        SetConsumerTokenInfoRequest request = (SetConsumerTokenInfoRequest) inActionContext.getParams();

        SecurityToken securityToken = request.getSecurityToken();
        TokenInfo tokenInfo = request.getTokenInfo();

        OAuthConsumer consumer = consumerMapper.execute(new OAuthConsumerRequest(request.getServiceName(),
                securityToken.getAppUrl()));
        if (consumer != null)
        {
            OAuthToken token = new OAuthToken(consumer, securityToken.getViewerId(), securityToken.getOwnerId(),
                    tokenInfo.getAccessToken(), tokenInfo.getTokenSecret());
View Full Code Here

     */
    @Override
    public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException
    {
        GetConsumerInfoRequest request = (GetConsumerInfoRequest) inActionContext.getParams();
        OAuthConsumer oauthConsumer = consumerMapper.execute(new OAuthConsumerRequest(request.getServiceName(), request
                .getSecurityToken().getAppUrl()));
        if (oauthConsumer == null)
        {
            throw new ExecutionException("OAuth Consumer was not found");
        }
        net.oauth.OAuthConsumer consumer = new net.oauth.OAuthConsumer(oauthConsumer.getCallbackURL(), oauthConsumer
                .getConsumerKey(), oauthConsumer.getConsumerSecret(), request.getProvider());
        consumer.setProperty(OAuth.OAUTH_SIGNATURE_METHOD, oauthConsumer.getSignatureMethod());
        ConsumerInfo consumerInfo = new ConsumerInfo(consumer, null, oauthConsumer.getCallbackURL());
        return new ConsumerInfoResponse(consumerInfo);
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.OAuthConsumer

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.