All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.autoconfigure.social.SecuritySocialAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.autoconfigure.social;

import org.zodiac.autoconfigure.redis.RedisTemplateAutoConfiguration;
import org.zodiac.autoconfigure.social.condition.ConditionalOnSecuritySocialEnabled;
import org.zodiac.core.context.annotation.ImportPropertySources;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.RedisTemplate;

@SpringBootConfiguration
@ConditionalOnSecuritySocialEnabled
@AutoConfigureAfter(value = {RedisTemplateAutoConfiguration.class})
@ImportPropertySources(value = {"classpath:/META-INF/config/social.yml"})
//@EnableConfigurationProperties(value = {SecuritySocialProperties.class})
@ConditionalOnClass(value = {me.zhyd.oauth.cache.AuthStateCache.class, org.zodiac.social.cache.AuthStateRedisCache.class})
public class SecuritySocialAutoConfiguration {

    public SecuritySocialAutoConfiguration() {
        super();
    }

    @Bean
    @ConditionalOnMissingBean
    @ConfigurationProperties(prefix = org.zodiac.social.constants.SocialSystemPropertiesConstants.SPRING_SECURITY_SOCIAL_PREFIX, ignoreInvalidFields = true)
    protected SecuritySocialProperties securitySocialProperties() {
        return new SecuritySocialProperties();
    }

    @Bean
    @ConditionalOnMissingBean(value = {com.xkcoding.http.support.Http.class})
    protected com.xkcoding.http.support.Http simpleHttp() {
        com.xkcoding.http.support.httpclient.HttpClientImpl httpClient = new com.xkcoding.http.support.httpclient.HttpClientImpl();
        com.xkcoding.http.HttpUtil.setHttp(httpClient);
        return httpClient;
    }

    @Bean
    @ConditionalOnMissingBean(value = {me.zhyd.oauth.cache.AuthStateCache.class})
    protected me.zhyd.oauth.cache.AuthStateCache authStateCache(RedisTemplate redisTemplate) {
        return new org.zodiac.social.cache.AuthStateRedisCache(redisTemplate, redisTemplate.opsForValue());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy