Giter VIP home page Giter VIP logo

spring-social-yahoo's People

Contributors

gabrielruiu avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

caipanjin danjee

spring-social-yahoo's Issues

Spring Boot YahooAutoConfiguration YahooTemplate parameters issue

I'm trying to implement YahooAutoConfiguration like for example org.springframework.boot.autoconfigure.social.TwitterAutoConfiguration:

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.social.config.annotation.EnableSocial;
import org.springframework.social.config.annotation.SocialConfigurerAdapter;
import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionFactory;
import org.springframework.social.connect.ConnectionRepository;
import org.springframework.social.connect.web.GenericConnectionStatusView;
import org.springframework.social.oauth2.OAuth2Template;
import org.springframework.web.servlet.View;

import com.github.gabrielruiu.springsocial.yahoo.api.Yahoo;
import com.github.gabrielruiu.springsocial.yahoo.api.impl.YahooTemplate;
import com.github.gabrielruiu.springsocial.yahoo.connect.YahooConnectionFactory;

/**
 * {@link EnableAutoConfiguration Auto-configuration} for Spring Social
 * connectivity with Yahoo.
 *
 */
@Configuration
@ConditionalOnClass({ SocialConfigurerAdapter.class, YahooConnectionFactory.class })
@ConditionalOnProperty(prefix = "spring.social.yahoo.", value = "app-id")
@AutoConfigureBefore(SocialWebAutoConfiguration.class)
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
public class YahooAutoConfiguration {

    @Configuration
    @EnableSocial
    @EnableConfigurationProperties(YahooProperties.class)
    @ConditionalOnWebApplication
    protected static class YahooAutoConfigurationAdapter extends SocialAutoConfigurerAdapter {

        @Autowired
        private YahooProperties properties;

        @Bean
        @ConditionalOnMissingBean(Yahoo.class)
        @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
        public Yahoo yahoo(ConnectionRepository repository) {
            Connection<Yahoo> connection = repository.findPrimaryConnection(Yahoo.class);

            if (connection != null) {
                return connection.getApi();
            }

            return connection != null ? connection.getApi() : new YahooTemplate(this.properties.getAppId(),
                    this.properties.getAppSecret(), ???????);
        }

        @Bean(name = { "connect/yahooConnect", "connect/yahooConnected" })
        @ConditionalOnProperty(prefix = "spring.social.", value = "auto-connection-views")
        public View yahooConnectView() {
            return new GenericConnectionStatusView("yahoo", "Yahoo");
        }

        @Override
        protected ConnectionFactory<?> createConnectionFactory() {
            YahooConnectionFactory factory = new YahooConnectionFactory(this.properties.getAppId(), this.properties.getAppSecret());
            return factory;
        }

    }

}

and right now I don't know where to get

String accessToken, String accessTokenSecret, String guid

for YahooTemplate. I have only this.properties.getAppId() and this.properties.getAppSecret()

It was enough for example for Google and GitHub OAuth providers. Why do I need to provide String accessToken, String accessTokenSecret, String guid parameters here ?

Interesting project

It's strange the lack of activity on Yahoo with Spring Social from the open source community. I wanted to ask if this project is still alive, if you accept PR and if you plan to make new releases on Maven central. I saw some functionalities are incomplete.
Thanks and nice work so far!

Profile operations (email, name..)

Why isn't the most basic operations implemented for it that includes the user profile info obtained by connection.fetchUserProfile(). I assume that would be the matter of implementing YahooAdapter.

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.