Class ApplicationConfig

java.lang.Object
es.kukenan.smartfi.common.config.ApplicationConfig

Base class for application configuration. Should be used in any service.
  • Constructor Details

    • ApplicationConfig

      public ApplicationConfig()
  • Method Details

    • customObjectMapper

      @Bean public CustomObjectMapper customObjectMapper()
      Global json object mapper bean. It is already configured to (de)serialize java8 date and datetime formats as ISO 8601 string date.
      Returns:
      the CustomObjectMapper.
    • restTemplateFactory

      @Bean public RestTemplateFactory restTemplateFactory()
      Global Rest template factory bean.
      Returns:
      global RestTemplateFactory.
    • totpGenerator

      @Bean @ConditionalOnProperty("otp.secretKey") public TotpGenerator totpGenerator(@Value("${otp.secretKey}") String secretKey, @Value("${otp.validTimeInSeconds}") Integer validTimeInSeconds)
      Global TOTP generator, only present if a secret key is defined.
      Parameters:
      secretKey - the secret key. This should be a String containing the key and should NOT be Base32 encoded. However: the key added to Google Authenticator SHOULD be Base32 encoded. So plaintext key in this method. Same key encoded with Base32 in Google Authenticator.
      validTimeInSeconds - Key validation time in seconds. When unsure: use 30 (default for Google Authenticator).
      Returns:
      TOTP generator.