The current implementation of case insensitivity in principal names in KIM requires that the PRNCPL_NM column in KRIM_PRNCPL_T be stored in all lowercase (see linked issue for original work surrounding this). This is implemented by a toLowerCase inside of the IdentityServiceImpl.getPrincipalByPrincipalName
Instead we should implement case insenstivity on principal names without requiring the data to be stored lowercase. I think the only effective way to do this in SQL is to do an UPPER on both ends of the query, for example;
SELECT * FROM KRIM_PRNCPL_T WHERE UPPER=UPPER(PRNCPL_NM)
Of course, there are some potential inefficiencies here related to indexing on the PRNCPL_NM column. There are a few ways we could attempt to address this:
1) If someone is implementing on Oracle they can put a function-based index on this column (not sure if mysql supports that or not)
2) We could add configuration parameters that allow implementers to specify whether KIM principal names are stored in all upper or all lowercase.
Of course, if they are going to be overridding the identity service and not storing data in these tables, it doesn't really matter. But that's going to depend on how a particular institution chooses to implement (and I could definitely see certain implementors choosing to store data in this table).