Open micobarac opened 11 months ago
Me too. In Spring Boot 3, there are some changes with register autoconfiguration beans in the starters. The file spring.factories has been removed.
Yeah, I also had this issue. You can fix it by doing this though:
@Configuration
public class MfaConfiguration {
@Bean
public TimeProvider timeProvider() {
return new SystemTimeProvider();
}
@Bean
public SecretGenerator secretGenerator() {
return new DefaultSecretGenerator();
}
@Bean
public CodeGenerator codeGenerator() {
return new DefaultCodeGenerator(HashingAlgorithm.SHA1);
}
@Bean
public CodeVerifier codeVerifier(CodeGenerator codeGenerator, TimeProvider timeProvider) {
return new DefaultCodeVerifier(codeGenerator, timeProvider);
}
}
Which is what it used to do
TotpAutoConfiguration
is not being loaded automatically bySpring Boot 3
. As a result, all beans defined inTotpAutoConfiguration
, such asSecretGenerator
,QrDataFactory
,QrGenerator
,CodeVerifier
, are not recognized.I had to import
TotpAutoConfiguration
manually in mySpring Boot 3
application: