Package org.eurekastreams.server.action.request.opensocial

Examples of org.eurekastreams.server.action.request.opensocial.CreateOAuthRequestTokenRequest


     * Test successful token creation.
     */
    @Test
    public void testSuccessfulTokenCreation()
    {
        final CreateOAuthRequestTokenRequest request = new CreateOAuthRequestTokenRequest(TEST_CONSUMER_KEY,
                TEST_OAUTH_VERSION, TEST_CALLBACK_URL);
        context.checking(new Expectations()
        {
            {
                oneOf(actionContext).getParams();
View Full Code Here


     * Test successful token creation with null callback.
     */
    @Test
    public void testSuccessfulTokenCreationWithNullCallback()
    {
        final CreateOAuthRequestTokenRequest request = new CreateOAuthRequestTokenRequest(TEST_CONSUMER_KEY,
                TEST_OAUTH_VERSION, null);
        context.checking(new Expectations()
        {
            {
                oneOf(actionContext).getParams();
View Full Code Here

     *
     */
    @Override
    public OAuthEntry execute(final PrincipalActionContext inActionContext) throws ExecutionException
    {
        CreateOAuthRequestTokenRequest currentRequest = (CreateOAuthRequestTokenRequest) inActionContext.getParams();
        OAuthEntry entry = new OAuthEntry();
        entry.setAppId(currentRequest.getConsumerKey());
        entry.setConsumerKey(currentRequest.getConsumerKey());
        entry.setDomain(oauthDomain);
        entry.setContainer(oauthContainer);

        entry.setToken(UUID.randomUUID().toString());
        entry.setTokenSecret(UUID.randomUUID().toString());

        entry.setType(OAuthEntry.Type.REQUEST);
        entry.setIssueTime(new Date());
        entry.setOauthVersion(currentRequest.getOauthVersion());
        if (currentRequest.getSignedCallbackUrl() != null)
        {
            entry.setCallbackUrlSigned(true);
            entry.setCallbackUrl(currentRequest.getSignedCallbackUrl());
        }

        OAuthDomainEntry dto = oauthConversionStrat.convertToEntryDTO(entry);
        insertMapper.execute(new PersistenceRequest<OAuthDomainEntry>(dto));
        return entry;
View Full Code Here

    public OAuthEntry generateRequestToken(final String consumerKey, final String oauthVersion,
            final String signedCallbackUrl) throws OAuthProblemException
    {
        try
        {
            CreateOAuthRequestTokenRequest currentRequest = new CreateOAuthRequestTokenRequest(consumerKey,
                    oauthVersion, signedCallbackUrl);
            ServiceActionContext currentContext = new ServiceActionContext(currentRequest, null);
            return (OAuthEntry) actionController.execute(currentContext, createOAuthRequestTokenAction);
        }
        catch (Exception ex)
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.action.request.opensocial.CreateOAuthRequestTokenRequest

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.