Sunday, 15 June 2014

java ee - Creating a security realm on WildFly 8.1.0 - Node path format is wrong around 'x' on issuing a command to create the realm -



java ee - Creating a security realm on WildFly 8.1.0 - Node path format is wrong around 'x' on issuing a command to create the realm -

when issuing next command on jboss-cli.bat (an ms-dos batch file windows) create security realm on wildfly 8.1.0 final mentioned in this migration guide,

class="lang-all prettyprint-override">./subsystem=security/security-domain=app:add(cache-type="default") cd ./subsystem=security/security-domain=app ./authentication=classic:add( login-modules=[ { code="database", flag="required", module-options={ dsjndiname="java:/jdbc/project_datasource", principalsquery="select password user_role_table user_id=?", rolesquery="select group_id, 'roles' group_table gt inner bring together user_role_table urt on gt.user_group_id = urt.user_id urt.user_id=?", hashalgorithm="sha-256", hashencoding="base64", unauthenticatedidentity="guest" } }, { code="rolemapping", flag="required", module-options={ rolesproperties="file:${jboss.server.config.dir}/app.properties", replacerole="false" } } ])

i next error on cli prompt :

node path format wrong around 'cd.' (index 67)

if cd removed, next error reported.

failed perform read-opration-description validate request: java.util.concurrent.executionexception: operation failed

the command given in contiguous text format follows.

class="lang-all prettyprint-override">./subsystem=security/security-domain=app:add(cache-type="default") cd ./subsystem=security/security-domain=app ./authentication=classic:add(login-modules=[ {code="database",flag="required",module-options={dsjndiname="java:/jdbc/project_datasource",principalsquery="select password user_role_table user_id=?",rolesquery="select group_id, 'roles' group_table gt inner bring together user_role_table urt on gt.user_group_id = urt.user_id urt.user_id=?",hashalgorithm="sha-256",hashencoding="base64",unauthenticatedidentity="guest"}},{code="rolemapping",flag="required",module-options={rolesproperties="file:${jboss.server.config.dir} /app.properties",replacerole="false"}}])

what fix? not want copy/past xml configuration file might different version version.

the problem combining more commands on single line.

the simple solution utilize external file store cli commands.

e.g. create security-domain.cli file in wildfly-8.1.0.final/bin folder next content (if want split command more lines, set backslash lastly character):

/subsystem=security/security-domain=app:add(cache-type="default") /subsystem=security/security-domain=app/authentication=classic:add() /subsystem=security/security-domain=app/authentication=classic/login-module=database:add( \ code="database", \ flag="required", \ module-options=[ \ ("dsjndiname"=>"java:/jdbc/project_datasource"), \ ("principalsquery"=>"select password user_role_table user_id=?"), \ ("rolesquery"=>"select group_id, 'roles' group_table gt inner bring together user_role_table urt on gt.user_group_id = urt.user_id urt.user_id=?"), \ ("hashalgorithm"=>"sha-256"), \ ("hashencoding"=>"base64"), \ ("unauthenticatedidentity"=>"guest") \ ]) /subsystem=security/security-domain=app/authentication=classic/login-module=rolemapping:add( \ code="rolemapping", \ flag="required", \ module-options=[ \ ("rolesproperties"=>"file:${jboss.server.config.dir}/app.properties"), \ ("replacerole"=>"false") \ ])

(your sample contains old style of setting login modules. it's deprecated way now, illustration usage new way.)

run new file jboss cli tool:

jboss-cli.bat -c --file=security-domain.cli

security java-ee wildfly java-ee-7 wildfly-8

No comments:

Post a Comment