Example usage for org.apache.shiro.authc.credential PasswordMatcher setPasswordService

List of usage examples for org.apache.shiro.authc.credential PasswordMatcher setPasswordService

Introduction

In this page you can find the example usage for org.apache.shiro.authc.credential PasswordMatcher setPasswordService.

Prototype

public void setPasswordService(PasswordService passwordService) 

Source Link

Usage

From source file:ch.reboundsoft.shinobi.authstore.realm.JdbcRealmFactory.java

@Inject
public JdbcRealmFactory(NinjaProperties ninjaProperties, RealmDataSource ds) {
    realm = new JdbcRealm();
    realm.setDataSource(ds.getDataSource());
    realm.setAuthenticationQuery(ninjaProperties.get("shinobi.db.authenticationQuery"));
    realm.setUserRolesQuery(ninjaProperties.get("shinobi.db.userRolesQuery"));
    realm.setPermissionsQuery(ninjaProperties.get("shinobi.db.permissionsQuery"));
    realm.setPermissionsLookupEnabled(true);
    PasswordMatcher pm = new PasswordMatcher();
    pm.setPasswordService(new DefaultPasswordService());
    realm.setCredentialsMatcher(pm);/*from   ww  w . j  ava  2 s  .  co m*/
}

From source file:com.github.pires.example.ShiroConfiguration.java

License:Apache License

@Bean(name = "credentialsMatcher")
public PasswordMatcher credentialsMatcher() {
    final PasswordMatcher credentialsMatcher = new PasswordMatcher();
    credentialsMatcher.setPasswordService(passwordService());
    return credentialsMatcher;
}

From source file:com.josue.shiro.cdi.custom.CustomEnvironmentLoaderListener.java

@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);//from w w w. j a v a2s  .com
    ((DefaultWebEnvironment) environment).setSecurityManager(rsm);
    return environment;
}

From source file:edu.pitt.dbmi.ccd.web.conf.ShiroConfigurer.java

License:Open Source License

@Bean(name = "credentialsMatcher")
public PasswordMatcher credentialsMatcher() {
    final PasswordMatcher credentialsMatcher = new PasswordMatcher();
    credentialsMatcher.setPasswordService(passwordService());

    return credentialsMatcher;
}

From source file:net.kr9ly.thinfw.dagger.module.AppSecurityManagerModule.java

License:Apache License

@ApplicationScope
@Provides// w  w  w.  ja  va2 s. c om
LoginRealm loginRealm(SQLDialect dialect, Settings settings) {
    PasswordMatcher passwordMatcher = new PasswordMatcher();
    passwordMatcher.setPasswordService(new DefaultPasswordService());
    LoginRealm realm = new LoginRealm(dialect, settings);
    realm.setCredentialsMatcher(passwordMatcher);
    return realm;
}

From source file:org.qi4j.library.shiro.domain.passwords.PasswordRealmMixin.java

License:Open Source License

public PasswordRealmMixin() {
    super();//from   ww  w .  j a v a2 s .  c om
    passwordService = new DefaultPasswordService();
    PasswordMatcher matcher = new PasswordMatcher();
    matcher.setPasswordService(passwordService);
    setCredentialsMatcher(matcher);
}

From source file:org.sonatype.nexus.security.internal.AuthenticatingRealmImpl.java

License:Open Source License

@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);//w  w w  . j av  a  2 s.  c o  m
    setAuthenticationCachingEnabled(true);
}

From source file:org.sonatype.security.realms.AuthenticatingRealmImpl.java

License:Open Source License

@Inject
public AuthenticatingRealmImpl(final ConfigurationManager configuration,
        final PasswordService passwordService) {
    this.configuration = configuration;
    this.passwordService = passwordService;

    PasswordMatcher passwordMatcher = new PasswordMatcher();
    passwordMatcher.setPasswordService(this.passwordService);
    setCredentialsMatcher(passwordMatcher);
    setName(ROLE);//ww  w. j  a  v a2 s.  c  om
    setAuthenticationCachingEnabled(true);
}

From source file:org.sonatype.security.realms.XmlAuthenticatingRealm.java

License:Open Source License

@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);
    setName(ROLE);//from   www .j av  a2s.  c om
}