Announcement Announcement Module
Collapse
No announcement yet.
simple two table datasource issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • simple two table datasource issue

    hey guys... i hope this is a simple issue that can be solved,

    Code:
    <jdbc-user-service data-source-ref="dataSource"
    users-by-username-query="SELECT A.user_name AS username, A.consumer_password AS password, A.enabled AS enabled FROM
    consumer A where A.user_name=?"
    authorities-by-username-query="SELECT A.username as username, A.password as password, R.name as authority FROM admin A, roles R WHERE A.roles=R.id AND A.username=?"/>
    </authentication-provider>
    this is interesting because users-by-username-query works fine but the authorities-by-username-query does not

  • #2
    edit: (edit wont work for some reason)

    here is the output for both query's in mysql


    SELECT A.username as username, A.password as password, R.name as authority FROM admin A, roles R WHERE A.roles=R.id AND A.username="admin";

    +----------+------------------------------------------------------------------+-----------+
    | username | password | authority |
    +----------+------------------------------------------------------------------+-----------+
    | admin | 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a 11ef721d1542d8 | ADMIN |
    +----------+------------------------------------------------------------------+-----------+

    SELECT A.user_name AS username, A.consumer_password AS password, A.enabled AS enabled FROM consumer A where A.user_name="adam";

    +----------+------------------------------------------------------------------+---------+
    | username | password | enabled |
    +----------+------------------------------------------------------------------+---------+
    | adam | 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a 11ef721d1542d8 | |
    +----------+------------------------------------------------------------------+---------+

    Comment

    Working...
    X