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

ext.springboot.FoundationCoreAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 0.17.31
Show newest version
package ext.springboot;

import dev.soffa.foundation.security.DefaultTokenProvider;
import dev.soffa.foundation.security.TokenProvider;
import dev.soffa.foundation.security.TokensConfig;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FoundationCoreAutoConfiguration {

    @Bean
    @ConfigurationProperties(prefix = "app.security.tokens")
    public TokensConfig createSecurityConfig() {
        return new TokensConfig();
    }

    @Bean
    public TokenProvider createJwtEncoder(TokensConfig config) {
        if (config.isValid()) {
            return new DefaultTokenProvider(config);
        }
        return null;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy