Hi Stuart, I am trying to achieve something similar to this but I needed to get the user attributes from my LDAP. Would you please guide me how you are able to get few attributes for the user as you have mentioned in your email. May I know your bean definition for the particular instance which fetch the user attributes.
Thanks. Farzan On 21 November 2012 14:55, Fletcher, Stuart (DPIPWE) < [email protected]> wrote: > Hi there, > > I am trying to setup CAS to return attributes related to an authenticated > user. These attributes reside in an oracle database. I have managed to get > some attributes returning correctly however some of the queries return > multiple rows and unfortunatly only the first row is being returned. I have > included the relevent fragment from the deployerConfigContext.xml file > below. The two attributes that should be returning multiple rows are > HasAccesToProducts and MemberOf in the productAttributeRepository and the > GroupAttributeRepository. If someone can give me a pointer on how to > implement multiple attributes with the same name that would be fantastic as > 2hrs of searching have yielded no examples. > > Thanks, > > Stuart > > <bean id="attributeRepository" > class="org.jasig.services.persondir.support.MergingPersonAttributeDaoImpl"> > <property name="personAttributeDaos"> > <list> > <ref bean="userAttributeRepository" /> > <ref bean="productAttributeRepository" /> > <ref bean="groupAttributeRepository" /> > </list> > </property> > </bean> > > <bean id="userAttributeRepository" > class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao"> > <constructor-arg index="0" ref="dataSource"/> > <constructor-arg index="1" value="SELECT > client_name,email_address,client_code FROM client WHERE {0}"/> > <property name="queryAttributeMapping"> > <map> > <entry key="username" value="client_code" /> > </map> > </property> > <property name="resultAttributeMapping"> > <map> > <entry key="client_name" value="Name" /> > <entry key="email_address" value="Email" /> > </map> > </property> > </bean> > > > <bean id="productAttributeRepository" > class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao"> > <constructor-arg index="0" ref="dataSource"/> > <constructor-arg index="1" value="SELECT product_code,client_code > FROM client_products WHERE {0}"/> > <property name="queryAttributeMapping"> > <map> > <entry key="username" value="client_code" /> > </map> > </property> > <property name="resultAttributeMapping"> > <map> > <entry key="product_code" value="HasAccessToProduct" /> > </map> > </property> > </bean> > > <bean id="groupAttributeRepository" > class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao"> > <constructor-arg index="0" ref="dataSource"/> > <constructor-arg index="1" value="SELECT package_code,client_code > FROM client_packages WHERE {0}"/> > <property name="queryAttributeMapping"> > <map> > <entry key="username" value="client_code" /> > </map> > </property> > <property name="resultAttributeMapping"> > <map> > <entry key="package_code" value="MemberOf" /> > </map> > </property> > </bean> > > ------------------------------ > > CONFIDENTIALITY NOTICE AND DISCLAIMER > The information in this transmission may be confidential and/or protected > by legal professional privilege, and is intended only for the person or > persons to whom it is addressed. If you are not such a person, you are > warned that any disclosure, copying or dissemination of the information is > unauthorised. If you have received the transmission in error, please > immediately contact this office by telephone, fax or email, to inform us of > the error and to enable arrangements to be made for the destruction of the > transmission, or its return at our cost. No liability is accepted for any > unauthorised use of the information contained in this transmission. > > -- > You are currently subscribed to [email protected] as: > [email protected] > To unsubscribe, change settings or access archives, see > http://www.ja-sig.org/wiki/display/JSG/cas-user > > -- *Farzan Qureshi* | Network Administrator & Help-desk Support | Rosmini College | (09) 487 0 530 -- This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager ( [email protected]). Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. Rosmini Collegeaccepts no liability for any damage caused by any virus transmitted by this email. -- You are currently subscribed to [email protected] as: [email protected] To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
