Ganael,

That error means that the class, 
PrincipalAttributeRegisteredServiceUsernameProvider, does not have a setter for 
the property, usernameAttribute.
You can set the 'switch' in the service definition. See further up the same 
page at 
https://apereo.github.io/cas/4.1.x/integration/Attribute-Release.html#principalattributeregisteredserviceusernameprovider.

Ray

On Thu, 2018-11-08 at 23:23 -0800, Ganael Laplanche wrote:
Hi,

I am using Cas 4.1.7 and trying to override the returned username ID with an 
LDAP attribute (uid), following that documentation :

https://apereo.github.io/cas/4.1.x/integration/Attribute-Release.html#returnallattributereleasepolicy

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.

--
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | [email protected]

-- 
- 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/1541784682.2817.26.camel%40uvic.ca.

Reply via email to