Try this:


<entry key="username">

  <list>

     <value>email</value>

     <value>username</value>

  </list>

</entry>





From: Jonathan Luthi [mailto:[email protected]]
Sent: Thursday, October 9, 2014 7:38 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [cas-user] Cas 4 - sql authentication with username or email 
and retrieve person attribute



I tried a lot of variants before posting my topic, but I'm not familiar with 
these kind of configuration files.

Maybe can you please explain me how use a collection in this case?



On Thursday, October 9, 2014 4:28:47 PM UTC+2, Misagh Moayyed wrote:

Have you tried using a collection of values instead of a single “email”?



From: Jonatha Luthi [mailto:[email protected] <javascript:> ]


Sent: Thursday, October 9, 2014 6:48 AM
To: [email protected] <javascript:>
Subject: [cas-user] Cas 4 - sql authentication with username or email and 
retrieve person attribute



Hi,



I'm trying to configure my CAS Server 4 to allow users to authenticate with 
username or email within a mysql database (using JDBC). So, in my 
primaryAuthenticationHandler I set the sql like this:



SELECT password FROM users WHERE LOWER(?) IN (LOWER(username), LOWER(email)) 
AND NOT deleted


It works, but my problem is that I'm using a SingleRowJdbcPersonAttributeDao 
to retrieve user attributes. Something like this:



...

<constructor-arg index="1" value="SELECT ... FROM users WHERE {0}" />

<property name="queryAttributeMapping">

    <map>

      <entry key="username" value="email" />

    </map>

</property>
...


Attributes are retrieved only when user log in with email (because query is 
translated as email=username).

So, I wonder if it's possible to have a query like this "...email=username 
OR username=username".



I really want to have login possible by username or email on my website.



Best regards,

Jonathan




-- 
You are currently subscribed to [email protected] <javascript:>  as: 
[email protected] <javascript:>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user
-- 
You are currently subscribed to [email protected] <javascript:>  as: 
[email protected] <javascript:>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user


-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to