cas.authn.attribute-repository.jdbc[0].case-canonicalization=NONE|LOWER|UPPER

It's been a while since we haven't used canonicalization, so I can't remember 
the details (like CAS 3.4). However, it used to be that CAS would return back 
the username attribute case matching whatever the user typed in. So if the end 
application wasn't doing anything, it could get different casings of the same 
user. I will admit to writing code that then failed because it wasn't expecting 
a different case. I always typed my username in all lower case, so it wasn't 
expect by me. You can also use canonicalization on the authentication bit as 
well.

On Thu, 2020-07-09 at 16:24 -0700, Parker Grimes wrote:
I recently set up a JDBC attributeRepository and my SQL query expects the 
username passed from CAS to be lowercase. Does anyone know how to either 
override the "WHERE {0}" or make sure the username being passed is lowercase?

The problem we have is people entering their username in mixed case like 
"UserName" instead of "username" and "UserName" is being passed to the "SELECT 
* FROM user_table WHERE {0}"

>From the logs:
DEBUG 
[org.apereo.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao] - 
<Generated query builder 'sql=[username = ?] args=[UserName]' from query Map 
{username=[UserName]}.>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/462fed9f6c0410aec06642f1c38aa02d61ec9a13.camel%40ndsu.edu.

Reply via email to