貝貝爸爸的程序人生

          關(guān)注Seam、BPM
          posts - 23, comments - 10, trackbacks - 0, articles - 32
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
          nnd,今天搞了快2個(gè)小時(shí),總是無法解決ldap支持的其他屬性返回問題,因?yàn)橹芭渲玫氖?.3.5版本,現(xiàn)在最新的版本是3.4.11,原來的配置竟然無法使用了,原來是因?yàn)樵黾臃?wù):
          <bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl">
          導(dǎo)致無法返回principal的其他屬性到客戶端,其實(shí)象這樣配置即可:<bean id="attributeRepository"
            class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
            <property name="contextSource" ref="contextSource" />
            <property name="baseDN" value="ou=users,${ldap.basePath}" />
            <property name="requireAllQueryAttributes" value="true" />
            <!--
            Attribute mapping beetween principal (key) and LDAP (value) names
            used to perform the LDAP search.  By default, multiple search criteria
            are ANDed together.  Set the queryType property to change to OR.
            
          -->
            <property name="queryAttributeMapping">
              <map>
                <entry key="username" value="uid" />
              </map>
            </property>
           
            <property name="resultAttributeMapping">
              <map>
              <!-- Mapping beetween LDAP entry attributes (key) and Principal's (value) -->
              <entry key="name" value="userName"/>
              <entry key="uid" value="userId"/>
              </map>
            </property>
          </bean>

              <bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl">
                  <property name="registeredServices">
                      <list>
                          <bean class="org.jasig.cas.services.RegisteredServiceImpl">
                              <property name="id" value="0" />
                              <property name="name" value="HTTP" />
                              <property name="description" value="Only Allows HTTP Urls" />
                              <property name="serviceId" value="http://**" />
                              <property name="evaluationOrder" value="10000001" />
                              <property name="ignoreAttributes" value="true" />
                          </bean>
                                          ………………
                                  </list>
                          </property>
                  </bean>
          如上所示,其中注冊(cè)的服務(wù)registeredServices
          默認(rèn)是不允許返回其他屬性到客戶端的!!!!!,真的是很坑爹啊,不過,配置一下ignoreAttributes即可,也可以指定allowedAttributes
          如下:
          <property name="allowedAttributes">
              <list>
                      <value><!-- your attribute key --></value>
              </list>
          </property>

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 手机| 北宁市| 乌拉特中旗| 阿图什市| 凯里市| 大石桥市| 云南省| 垫江县| 民乐县| 玉溪市| 宁明县| 江安县| 来安县| 乌拉特中旗| 平阳县| 桦甸市| 吴堡县| 济南市| 绥阳县| 上高县| 辽中县| 德庆县| 轮台县| 平湖市| 中方县| 浮山县| 安庆市| 石渠县| 马尔康县| 长阳| 怀柔区| 丰镇市| 青岛市| 长乐市| 房产| 沙田区| 古蔺县| 城口县| 崇义县| 六安市| 酉阳|