@Bean
    public Realm realm() {
        TextConfigurationRealm realm = new TextConfigurationRealm();
        realm.setUserDefinitions("joe.coder=password,user\n" + "jill.coder=password,admin");

        realm.setRoleDefinitions("admin=read,write\n" + "user=read");
        realm.setCachingEnabled(true);
        return realm;
    }
Example hard coded Realm bean.

@return hard coded Realm bean
samples/spring-boot/src/main/java/org/apache/shiro/samples/CliApp.java