Example usage for org.apache.shiro.realm.text PropertiesRealm PropertiesRealm

List of usage examples for org.apache.shiro.realm.text PropertiesRealm PropertiesRealm

Introduction

In this page you can find the example usage for org.apache.shiro.realm.text PropertiesRealm PropertiesRealm.

Prototype

public PropertiesRealm() 

Source Link

Usage

From source file:io.vertx.ext.auth.impl.realms.PropertiesAuthRealm.java

License:Open Source License

@Override
public void init(JsonObject config) {
    this.config = config;
    PropertiesRealm propsRealm = new PropertiesRealm();
    String resourcePath = config.getString(PROPERTIES_PROPS_PATH_FIELD);
    if (resourcePath != null) {
        propsRealm.setResourcePath(resourcePath);
    } else {/* w  w  w  .j a  va2  s  . c om*/
        propsRealm.setResourcePath("classpath:vertx-users.properties");
    }
    propsRealm.init();
    this.securityManager = new DefaultSecurityManager(propsRealm);
    this.realm = propsRealm;
}

From source file:io.vertx.ext.auth.shiro.impl.PropertiesAuthProvider.java

License:Open Source License

public static Realm createRealm(JsonObject config) {
    PropertiesRealm propsRealm = new PropertiesRealm();
    String resourcePath = config.getString(PROPERTIES_PROPS_PATH_FIELD);
    if (resourcePath != null) {
        propsRealm.setResourcePath(resolve(resourcePath));
    } else {/*ww w.  j a v a 2 s .  c  o m*/
        propsRealm.setResourcePath("classpath:vertx-users.properties");
    }
    propsRealm.init();
    return propsRealm;
}

From source file:io.vertx.ext.auth.shiro.impl.PropertiesAuthRealm.java

License:Open Source License

public PropertiesAuthRealm(JsonObject config) {
    PropertiesRealm propsRealm = new PropertiesRealm();
    String resourcePath = config.getString(PROPERTIES_PROPS_PATH_FIELD);
    if (resourcePath != null) {
        propsRealm.setResourcePath(resourcePath);
    } else {//  w ww  . ja v a2 s.  c o m
        propsRealm.setResourcePath("classpath:vertx-users.properties");
    }
    propsRealm.init();
    this.securityManager = new DefaultSecurityManager(propsRealm);
    this.realm = propsRealm;
}

From source file:org.codehaus.griffon.runtime.shiro.DefaultSecurityManagerFactory.java

License:Apache License

public SecurityManager createSecurityManager(GriffonApplication app) {
    PropertiesRealm realm = new PropertiesRealm();
    String resourcePath = ConfigUtils.getConfigValueAsString(app.getConfig(), KEY_REALM_RESOURCE_PATH,
            DEFAULT_REALM_RESOURCE_PATH);
    realm.setResourcePath(resourcePath);
    realm.init();/*from w w  w  .j  a  va 2  s.c o m*/
    return new DefaultSecurityManager(realm);
}

From source file:org.codehaus.griffon.runtime.shiro.SecurityManagerProvider.java

License:Apache License

@Override
public SecurityManager get() {
    PropertiesRealm realm = new PropertiesRealm();
    String resourcePath = configuration.getAsString(KEY_REALM_RESOURCE_PATH, DEFAULT_REALM_RESOURCE_PATH);
    realm.setResourcePath(resourcePath);
    realm.init();/*from  w w  w . java2s.c  o  m*/
    return new DefaultSecurityManager(realm);
}

From source file:org.debux.webmotion.shiro.ShiroListener.java

License:Open Source License

/**
 * @return basic realm in properties file on classpath
 *///from w w w.java2 s.c  o  m
protected Realm getRealm() {
    PropertiesRealm realm = new PropertiesRealm();
    realm.setResourcePath("classpath:shiro.properties");
    realm.init();
    return realm;
}