Digging thru code:
SimpleUsernameAttributeProvider.java, method getUsernameAttributeValues, 
there is this line:
if (query.containsKey(this.usernameAttribute)) { ...}

I see I can perhaps override the username with a userNameAttribute. I have 
not found any config where I can define this value. 

Anyone know what property controls this?

-psv

On Wednesday, July 19, 2023 at 3:58:01 PM UTC-5 Pablo Vidaurri wrote:

> Config info:
>
> cas.authn.attribute-repository.jdbc[0].sql=select a, b, c from user_table 
> where {0}
> cas.authn.attributeRepository.jdbc[0].username=USER_ID
> cas.authn.ldap[0].principalAttributeId: uid   <-- uid is jsmith but login 
> user name at UI is [email protected]
>
> Looks like principle (uid) is not being used and instead the username from 
> credentials. *Is this a bug?*
>
> Log info:
>
> 2023-07-19 13:22:08,418 DEBUG 
> [org.apereo.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao] 
> - <Adding attribute 'USER_ID' with value '[[email protected]]' to query 
> builder 'null'>
>
> 2023-07-19 13:22:08,429 DEBUG 
> [org.apereo.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao] 
> - <Generated query builder 'sql=[USER_ID = ?] args=[[email protected]]' 
> from query Map {principal=[jsmith], Email=[[email protected]], 
> firstName=[John], GivenName=[John], lastName=[Smith], 
> credentialClass=[UsernamePasswordCredential], credentialId=[
> [email protected]], username=[[email protected]]}.>
>
> 2023-07-19 13:22:08,430 DEBUG 
> [org.apereo.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao] 
> - <Executing 'SELECT A, B, C from USER_TABLE WHERE {0}' with arguments [
> [email protected]]>
>
> 2023-07-19 13:22:09,818 DEBUG 
> [org.apereo.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao] 
> - <Executed 'SELECT A, B, C from  USER_TABLE   WHERE {0}' with arguments [
> [email protected]] and got results []>
>
> On Friday, July 14, 2023 at 5:10:14 AM UTC-5 Pablo Vidaurri wrote:
>
>> I have a single row lookup, so i have in my config:
>> cas.authn.attribute-repository.jdbc[0].sql=select * from user_table where 
>> {0}
>> cas.authn.attributeRepository.jdbc[0].username=USER_ID
>>
>> This seems to search by the user id entered at the login page. But I'd 
>> like to use the value from the resolved principle provided by LDAP:
>>
>> cas.authn.ldap[0].principalAttributeId: uid
>>
>> So user logs in with jsmith88 and ldap resolves the principle to be 
>> [email protected].
>> I'd like to use the principle value to look up jdbc userAttributes.
>>
>> Any way to configure CAS to do that?
>>
>>
>>

-- 
- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/20f7ec99-6575-4148-809b-f93695c96e4fn%40apereo.org.

Reply via email to