Beispiel #1
0
 @Bean
 public UsersConnectionRepository usersConnectionRepository() {
   JdbcUsersConnectionRepository repository =
       new JdbcUsersConnectionRepository(
           dataSource, connectionFactoryLocator(), Encryptors.noOpText());
   repository.setConnectionSignUp(ConnectionSignUp());
   return repository;
 }
Beispiel #2
0
 @Override
 public UsersConnectionRepository getUsersConnectionRepository(
     ConnectionFactoryLocator connectionFactoryLocator) {
   JdbcUsersConnectionRepository repository =
       new JdbcUsersConnectionRepository(
           dataSource, connectionFactoryLocator, Encryptors.noOpText());
   repository.setConnectionSignUp(new AccountConnectionSignUpService(usersDao));
   return repository;
 }
  @Override
  public void afterPropertiesSet() throws Exception {

    JdbcUsersConnectionRepository usersConnectionRepositiory =
        new JdbcUsersConnectionRepository(
            dataSource, connectionFactoryLocator(), Encryptors.noOpText());

    socialContext =
        new SocialContext(usersConnectionRepositiory, new UserCookieGenerator(), facebook());

    usersConnectionRepositiory.setConnectionSignUp(socialContext);
    this.usersConnectionRepositiory = usersConnectionRepositiory;
  }
 @Before
 public void setUp() {
   EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
   if (testMySqlCompatiblity) {
     factory.setDatabaseConfigurer(new MySqlCompatibleH2DatabaseConfigurer());
   } else {
     factory.setDatabaseType(EmbeddedDatabaseType.H2);
   }
   ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
   populator.addScript(new ClassPathResource(getSchemaSql(), getClass()));
   factory.setDatabasePopulator(populator);
   database = factory.getDatabase();
   dataAccessor = new JdbcTemplate(database);
   connectionFactoryRegistry = new ConnectionFactoryRegistry();
   connectionFactory = new TestFacebookConnectionFactory();
   connectionFactoryRegistry.addConnectionFactory(connectionFactory);
   usersConnectionRepository =
       new JdbcUsersConnectionRepository(
           database, connectionFactoryRegistry, Encryptors.noOpText());
   if (!getTablePrefix().equals("")) {
     usersConnectionRepository.setTablePrefix(getTablePrefix());
   }
   connectionRepository = usersConnectionRepository.createConnectionRepository("1");
 }
 @Bean
 public TextEncryptor textEncryptor() {
   return Encryptors.queryableText(
       env.getProperty("security.encryptPassword", "password"),
       env.getProperty("security.encryptSalt", "00"));
 }
 @Bean
 public TextEncryptor textEncryptor() {
   return Encryptors.noOpText();
 }