Emil Cervenan edited a comment on Bug JDF-527

Actually, this configuration is possible. But it's a little bit hacky. I agree with Ron that security domain with DB login module would be closer to common practice. However this is the way how to configure Openshift to run quickstart on it as it is.

  • On your local EAP/JBoss instance run add-user.sh script and enter requested data(applicationRealm, userName, password, role)
  • Script will create/edit application-users.properties and application-roles.properties files in $JBOSS_HOME/standalone/configuration directory
  • scp this files to openshift gear to UUID@appname-namespace.rhcloud.com:~/jbosseap/standalone/configuration directory (or whatever host).
  • Edit standalone.xml file on openshift cartridge
    • scp standalone.xml from openshift cartridge to your local and set up security realm
       <management>
              <security-realms>
                  <security-realm name="ApplicationRealm">
                      <authentication>
                          <local default-user="$local" allowed-users="*"/>
                          <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
                      </authentication>
                      <authorization>
                          <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
                      </authorization>
                  </security-realm>
              </security-realms>
       ...
       </management>
       

      Copy edited file to cloned git repository of your Openshift application appname/.openshift/config and push changes.

    • Or redirect remote Openshift ports to your local ports with red hat cloud tools https://www.openshift.com/developers/rhc-client-tools-install
      rhc port-forward appname

      Run jboss-cli.sh script from your local EAP instance ($JBOSS_HOME/bin/)
      In CLI tool type:

      connect
      /core-service=management/security-realm=ApplicationRealm:add() 
      /core-service=management/security-realm=ApplicationRealm/authentication=local:add(default-user=$local,allowed-users=*)
      /core-service=management/security-realm=ApplicationRealm/authentication=properties:add(path=application-users.properties, relative-to=jboss.server.config.dir)
      /core-service=management/security-realm=ApplicationRealm/authorization=properties:add(path=application-roles.properties, relative-to=jboss.server.config.dir)
  • Deploy archive or push sources and test.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira