Hi,
I am using Cas 4.1.7 and trying to override the returned username ID with an LDAP attribute (uid), following that documentation :
Here is the configuration for the service:
<bean class="org.jasig.cas.services.RegexRegisteredService"
p:id="1"
p:name="Authentication on XXX"
p:serviceId="XXX"
p:evaluationOrder="1">
<property name="attributeReleasePolicy">
<bean class="org.jasig.cas.services.ReturnAllAttributeReleasePolicy" />
</property>
<property name="usernameAttributeProvider">
<bean class="org.jasig.cas.services.PrincipalAttributeRegisteredServiceUsernameProvider">
<property name="usernameAttribute" value="uid" />
</bean>
</property>
</bean>
Unfortunately, when rebuilding the application, I get the following error message :
"Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'usernameAttribute' of bean class [org.jasig.cas.services.PrincipalAttributeRegisteredServiceUsernameProvider]: Bean property 'usernameAttribute' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?"
If I explicitly switch back to the default username provider using the following config, it builds fine again:
<property name="usernameAttributeProvider">
<bean class="org.jasig.cas.services.DefaultRegisteredServiceUsernameProvider" />
</property>
I must be missing something... Any hint ?
Best regards,
Ganael.