我对校长使用的查询是通过数据库工作的,我得到了一个记录
select 'role', password from t_user where username = 'jdoe';
但是,当我尝试通过jboss-cli.sh
使用它时./subsystem=elytron/jdbc-realm=jdbc-realm:add(principal-query=[{
data-source=MySqlDSroscam,
sql="SELECT 'role', password FROM t_user WHERE username = ?",
attribute-mapping=[{index=1, to=Roles}]
simple-digest-mapper={algorithm=simple-digest-md5, password-index=2},
}])
我得到此错误
{
"outcome" => "failed",
"failure-description" => "WFLYCTL0097: Wrong type for 'principal-query'. Expected [LIST] but was OBJECT",
"rolled-back" => true
}
您只有额外的逗号( ,
( simple-digest-mapper
value;(
按照预期的遵循工作:
./subsystem=elytron/jdbc-realm=jdbc-realm:add(principal-query=[{
data-source=MySqlDSroscam,
sql="SELECT 'role', password FROM t_user WHERE username = ?",
attribute-mapping=[{index=1, to=Roles}],
simple-digest-mapper={algorithm=simple-digest-md5, password-index=2}
}])