public class CustomEnvironmentLoaderListener extends EnvironmentLoaderListener { @Inject private JpaRealm jpaRealm; @Override protected WebEnvironment createEnvironment(ServletContext pServletContext) { WebEnvironment environment = super.createEnvironment(pServletContext); RealmSecurityManager rsm = (RealmSecurityManager) environment.getSecurityManager(); PasswordService passwordService = new DefaultPasswordService(); PasswordMatcher passwordMatcher = new PasswordMatcher(); passwordMatcher.setPasswordService(passwordService); jpaRealm.setCredentialsMatcher(passwordMatcher); rsm.setRealm(jpaRealm); ((DefaultWebEnvironment) environment).setSecurityManager(rsm); return environment; } }
@Inject public XmlAuthenticatingRealm( @Named( "default" ) ConfigurationManager configuration, PasswordService passwordService) { this.configuration = configuration; this.passwordService = passwordService; PasswordMatcher passwordMatcher = new PasswordMatcher(); passwordMatcher.setPasswordService(this.passwordService); setCredentialsMatcher( passwordMatcher ); }
@Bean(name = "credentialsMatcher") public PasswordMatcher credentialsMatcher() { final PasswordMatcher credentialsMatcher = new PasswordMatcher(); credentialsMatcher.setPasswordService(passwordService()); return credentialsMatcher; }
@Inject public OneAuthorizingRealm(UserManager userManager, CacheManager cacheManager, SettingManager configManager, MembershipManager membershipManager, GroupManager groupManager) { PasswordMatcher passwordMatcher = new PasswordMatcher(); passwordMatcher.setPasswordService(AppLoader.getInstance(PasswordService.class)); setCredentialsMatcher(passwordMatcher); this.userManager = userManager; this.cacheManager = cacheManager; this.configManager = configManager; this.membershipManager = membershipManager; this.groupManager = groupManager; }
public PasswordRealmMixin() { super(); passwordService = new DefaultPasswordService(); PasswordMatcher matcher = new PasswordMatcher(); matcher.setPasswordService( passwordService ); setCredentialsMatcher( matcher ); }
public PasswordRealmMixin() { super(); passwordService = new DefaultPasswordService(); PasswordMatcher matcher = new PasswordMatcher(); matcher.setPasswordService( passwordService ); setCredentialsMatcher( matcher ); }
@Inject public AuthenticatingRealmImpl(final SecurityConfigurationManager configuration, final PasswordService passwordService) { this.configuration = configuration; this.passwordService = passwordService; PasswordMatcher passwordMatcher = new PasswordMatcher(); passwordMatcher.setPasswordService(this.passwordService); setCredentialsMatcher(passwordMatcher); setName(NAME); setAuthenticationCachingEnabled(true); }
protected void setup(HashService hashService, HashFormat hashFormat) { PortofinoPasswordService passwordService = new PortofinoPasswordService(); passwordService.setHashService(hashService); passwordService.setHashFormat(hashFormat); PasswordMatcher passwordMatcher = new PasswordMatcher(); passwordMatcher.setPasswordService(passwordService); setCredentialsMatcher(passwordMatcher); this.passwordService = passwordService; } }
protected void setup(HashService hashService, HashFormat hashFormat) { PortofinoPasswordService passwordService = new PortofinoPasswordService(); passwordService.setHashService(hashService); passwordService.setHashFormat(hashFormat); PasswordMatcher passwordMatcher = new PasswordMatcher(); passwordMatcher.setPasswordService(passwordService); setCredentialsMatcher(passwordMatcher); this.passwordService = passwordService; this.legacyHashing = false; } }
public MyRealmMixin() { super(); passwordService = new DefaultPasswordService(); PasswordMatcher matcher = new PasswordMatcher(); matcher.setPasswordService( passwordService ); setCredentialsMatcher( matcher ); }
public MyRealmMixin() { super(); passwordService = new DefaultPasswordService(); PasswordMatcher matcher = new PasswordMatcher(); matcher.setPasswordService( passwordService ); setCredentialsMatcher( matcher ); }
@Configuration public class SecurityConfiguration { private static final String PRIVATE_SALT = "ourprivatesalt"; private PasswordService passwordService; private PasswordMatcher credentialsMatcher = new PasswordAndSystemCredentialsMatcher(); private AuthenticatingSecurityManager securityManager; @Bean public PasswordService passwordService() { if (passwordService == null) { DefaultPasswordService defaultPasswordService = new DefaultPasswordService(); passwordService = defaultPasswordService; DefaultHashService defaultHashService = (DefaultHashService) defaultPasswordService.getHashService(); defaultHashService.setPrivateSalt(new SimpleByteSource(PRIVATE_SALT)); } return passwordService; } @Bean public CredentialsMatcher credentialsMatcher() { credentialsMatcher.setPasswordService(passwordService()); return credentialsMatcher; }