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

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

Introduction

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

Prototype

public PasswordMatcher() 

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  w w w  . j  a v  a2  s.  com
}

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);// w w w. jav  a  2  s  .  c  o  m
    ((DefaultWebEnvironment) environment).setSecurityManager(rsm);
    return environment;
}

From source file:com.meltmedia.cadmium.servlets.shiro.PersistablePropertiesRealm.java

License:Apache License

public PersistablePropertiesRealm() {
    super();/*from  w  w w  . j a  v a 2s. co m*/
    this.setName("cadmium-realm");
    this.setCredentialsMatcher(new PasswordMatcher());
}

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/*from  w  w  w.  j  av a 2s .  c o m*/
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.icgc.dcc.submission.shiro.RealmProvider.java

License:Open Source License

private DccWrappingRealm buildDccWrappingRealm(String shiroIniFilePath) {
    DccWrappingRealm dccWrappingRealm = new DccWrappingRealm(projectService);
    dccWrappingRealm.setResourcePath("file:" + shiroIniFilePath);// TODO: existing constant for that?
    dccWrappingRealm.init();//from  w w  w .j  a v  a 2s  .  co  m
    dccWrappingRealm.setCredentialsMatcher(new PasswordMatcher());
    // TODO investigate caching particulars
    dccWrappingRealm.setAuthorizationCachingEnabled(false);
    return dccWrappingRealm;
}

From source file:org.obiba.mica.security.SecurityManagerFactory.java

License:Open Source License

private Realm micaIniRealm() {
    IniRealm iniRealm = new IniRealm("classpath:shiro.ini");
    iniRealm.setName(INI_REALM);//  ww w .  j  a v a2s  .c o m
    iniRealm.setRolePermissionResolver(rolePermissionResolver);
    iniRealm.setPermissionResolver(permissionResolver);
    iniRealm.setCredentialsMatcher(new PasswordMatcher());

    return iniRealm;
}

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

License:Open Source License

public PasswordRealmMixin() {
    super();/*from ww w  .jav  a 2s.c  o  m*/
    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);//from  www. j  a  v  a 2 s.c  o m
    setAuthenticationCachingEnabled(true);
}