use of org.cloudfoundry.identity.uaa.mfa.JdbcMfaProviderProvisioning in project uaa by cloudfoundry.
the class IdentityZoneConfigurationBootstrapTests method configureProvisioning.
@BeforeEach
public void configureProvisioning(@Autowired JdbcTemplate jdbcTemplate) {
TestUtils.cleanAndSeedDb(jdbcTemplate);
provisioning = new JdbcIdentityZoneProvisioning(jdbcTemplate);
bootstrap = new IdentityZoneConfigurationBootstrap(provisioning);
GeneralMfaProviderValidator mfaProviderValidator = new GeneralMfaProviderValidator();
MfaProviderProvisioning mfaProvisoning = new JdbcMfaProviderProvisioning(jdbcTemplate, mfaProviderValidator);
MfaProvider<GoogleMfaProviderConfig> provider = new MfaProvider<>();
provider.setName("testProvider");
provider.setType(MfaProvider.MfaProviderType.GOOGLE_AUTHENTICATOR);
provider.setConfig(new GoogleMfaProviderConfig());
provider.setIdentityZoneId("uaa");
mfaProvisoning.create(provider, "uaa");
MfaConfigValidator mfaConfigValidator = new MfaConfigValidator(mfaProvisoning);
GeneralIdentityZoneConfigurationValidator configValidator = new GeneralIdentityZoneConfigurationValidator(mfaConfigValidator);
validator = new GeneralIdentityZoneValidator(configValidator);
bootstrap.setValidator(validator);
// For the SamlTestUtils keys we are using.
Security.addProvider(new BouncyCastleProvider());
}
Aggregations