0

The query I use to principals it works through database and I get a record

select 'role', password from t_user where username = 'jdoe';

but when I try to use it through 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}, \
}])

I get this error

{
    "outcome" => "failed",
    "failure-description" => "WFLYCTL0097: Wrong type for 'principal-query'. Expected [LIST] but was OBJECT",
    "rolled-back" => true
}
Joe
  • 7,749
  • 19
  • 60
  • 110

1 Answers1

1

You have just additional comma (,) after simple-digest-mapper value ;)

Following works as expected:

./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} \
}])
Honza
  • 974
  • 10
  • 18