0

我对委托人使用的查询通过数据库工作,我得到了一条记录

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
}
4

1 回答 1

1

值后只有额外的逗号 ( ,) simple-digest-mapper;)

以下按预期工作:

./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} \
}])
于 2018-03-08T12:24:27.670 回答