貝貝爸爸的程序人生

          關(guān)注Seam、BPM
          posts - 23, comments - 10, trackbacks - 0, articles - 32
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
          nnd,今天搞了快2個小時,總是無法解決ldap支持的其他屬性返回問題,因為之前配置的是3.3.5版本,現(xiàn)在最新的版本是3.4.11,原來的配置竟然無法使用了,原來是因為增加服務(wù):
          <bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl">
          導(dǎo)致無法返回principal的其他屬性到客戶端,其實象這樣配置即可:<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>
          如上所示,其中注冊的服務(wù)registeredServices
          默認(rèn)是不允許返回其他屬性到客戶端的!!!!!,真的是很坑爹啊,不過,配置一下ignoreAttributes即可,也可以指定allowedAttributes
          如下:
          <property name="allowedAttributes">
              <list>
                      <value><!-- your attribute key --></value>
              </list>
          </property>

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 云和县| 宁德市| 上杭县| 四平市| 丰原市| 江都市| 黔江区| 贵阳市| 仪陇县| 万盛区| 启东市| 普兰店市| 台安县| 泰州市| 游戏| 盐亭县| 鸡东县| 临夏市| 永丰县| 保亭| 浦江县| 镇雄县| 汾阳市| 广州市| 榆中县| 肃南| 讷河市| 无锡市| 洪江市| 临武县| 罗平县| 长宁县| 资中县| 周口市| 彭泽县| 广宗县| 汽车| 横山县| 镇平县| 洮南市| 独山县|