【问题标题】:How to connect shibboleth idp to mysql instead of LDAP server?如何将 shibboleth idp 连接到 mysql 而不是 LDAP 服务器?
【发布时间】:2018-11-13 06:30:44
【问题描述】:

我正在尝试在 Windows 机器上安装 shibboleth IDP 和 SP。我的目标是使用 mysql 而不是 LDAP。找不到任何相关来源。请帮忙!

【问题讨论】:

    标签: shibboleth


    【解决方案1】:

    如果您询问如何配置 Shibboleth IdP 以提供从 MySQL 源派生的属性,您可以使用 <DataConnector> 元素。下面的例子在mysqldb.example.com处连接数据库shibboleth,并定义属性sn

    # In the file attribute-resolver.xml (version 3.3 of Shibboleth Idp)
    <AttributeDefinition 
       xmlns="urn:mace:shibboleth:2.0:resolver:ad"
       xsi:type="Simple" id="sn" sourceAttributeID="sn">
      <Dependency ref="mysqlconnector" />
      <AttributeEncoder xsi:type="SAML2String" 
         xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
         name="urn:oid:2.5.4.4" friendlyName="sn" />
    </AttributeDefinition>
    
    <DataConnector id="mysqlconnector" xsi:type="RelationalDatabase">
      <ApplicationManagedConnection
         jdbcDriver="com.mysql.jdbc.Driver"
         jdbcURL="jdbc:mysql://mysqldb.example.com/shibboleth"
         jdbcUserName="username"
         jdbcPassword="password" />
      <QueryTemplate>
        <![CDATA[
          SELECT sn
          FROM users
          WHERE userid='$resolutionContext.principal'
         ]]>
      </QueryTemplate>
    </DataConnector>
    

    请注意,以上内容适用于 Shibboleth Idp 3.3 版;如需更多信息,请参阅the Shibboleth RelationalDatabaseConnector documentation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-24
      • 2013-03-26
      • 2015-03-19
      • 2020-01-12
      • 2016-11-03
      • 2020-07-18
      • 2017-08-23
      相关资源
      最近更新 更多