Liberty 設定檔中的 SCIM 作業

Liberty 中支援「跨網域身分管理系統 (SCIM) 1.1」規格。

擷取資源

WebSphere Application Server Liberty 支援 SCIM 1.1 規格。如需規格的相關資訊,請參閱 http://www.simplecloud.info/

如果要擷取已知資源,您必須傳送 GET 要求到所配置的 HTTP 端點。例如 /Users/{id} 或 /Groups/{id}

下列範例顯示針對 LDAP 登錄所執行的作業。
    <ldapRegistry id="LDAP1" realm="SampleLdapIDSRealm" host="9.127.1.90" port="1389" ignoreCase="true"
        baseDN="o=ibm,c=us" ldapType="IBM Tivoli Directory Server" searchTimeout="8m" recursiveSearch="true"
        bindDN="xxxxxx" bindPassword="xxxxxxx">
	    <ldapEntityType name="PersonAccount">
	        <rdnProperty name="uid" objectClass="inetOrgPerson"/>
                <objectClass>inetOrgPerson</objectClass>
            </ldapEntityType>
            <ldapEntityType name="Group">
	        <objectClass>groupofnames</objectClass>
		<objectClass>ibm-nestedGroup</objectClass>
		  <rdnProperty name="cn" objectClass="groupofnames"/>
	    </ldapEntityType>
    <attributeConfiguration>
        <attribute name="title" propertyName="honorificPrefix" syntax="String" entityType="PersonAccount">
        </attribute>
	<attribute name="initials" propertyName="middleName" syntax="String" entityType="PersonAccount">
        </attribute>
	<attribute name="st" propertyName="honorificSuffix" syntax="String" entityType="PersonAccount">
        </attribute>
	<attribute name="l" propertyName="homeStateOrProvinceName" syntax="String" entityType="PersonAccount">
        </attribute>
	<attribute name="street" propertyName="homeStreet" syntax="String" entityType="PersonAccount">
        </attribute>
	<attribute name="postalAddress" propertyName="homeCity" syntax="String" entityType="PersonAccount">
        </attribute>
	<attribute name="postalCode" propertyName="homePostalCode" syntax="String" entityType="PersonAccount">
        </attribute>
       <attribute name="postOfficeBox" propertyName="homeCountryName" syntax="String" entityType="PersonAccount">
        </attribute>
        <attribute name="departmentNumber" propertyName="photoURLThumbnail" syntax="String" entityType="PersonAccount">
        </attribute>
	<attribute name="description" propertyName="photoURL" syntax="String" entityType="PersonAccount">
        </attribute>
    </attributeConfiguration>
    <groupProperties>
        <memberAttribute name="member" dummyMember="uid=dummy" objectClass="groupOfNames" scope="direct"/>
	<memberAttribute name="ibm-memberGroup" objectClass="ibm-nestedGroup" scope="direct"/>
    </groupProperties>
</ldapRegistry>
如果要從 LDAP 擷取資源,您必須以 https://localhost:9090/ibm/api/scim/Users/uid=jsmith,o=ibm,c=us 形式來傳送 GET 要求。

查詢資源

如果要查詢資源,您必須傳送 GET 要求到所配置的 HTTP 端點,並指定過濾器以進行搜尋。您也可以指定 attributes 參數,以便從所傳回的資源傳回一部分的值,並指定分頁和排序參數,以便組織所傳回的資源。下列範例顯示部分的過濾選項:
  • 指定參數以擷取一部分的值:例如 https://localhost:9090/ibm/api/scim/Users?filter=givenname sw "Jo",是擷取名稱開頭為 “Jo” 的所有使用者。
  • 指定 attributes 參數,以擷取一部分的值:例如 https://localhost:9090/ibm/api/scim/Users?filter=givenname sw "Jo"&attributes=username,emails&filter=name.familyname eq "Smith",是擷取開頭為 “Jo” 且姓氏為 “Smith” 之使用者名稱的電子郵件位址。
  • 指定分頁和排序參數,以擷取經過組織的資源。例如 https://localhost:9090/ibm/api/scim/Users?filter=givenname sw "Jo"&attributes=username&sortBy=username&startIndex=3&count=5,是擷取排序結果的第三頁,且排序結果的每一頁都含有五個使用者名稱,而這些使用者名稱的開頭都是 “Jo”,姓氏都是 “Smith”
附註:
  • 基礎聯合儲存庫會判斷過濾器中指定的值是否區分大小寫。就 LDAP 來說,除非屬性對映至區分大小寫的 LDAP 屬性,依預設,值不區分大小寫。
  • 在搜尋過濾器中無法使用使用者名稱。
  • 當聯合基本、SAF 或不支援 SCIM 屬性的自訂登錄時,一律會根據使用者名稱來搜尋過濾型樣,且只會傳回使用者名稱屬性。

建立資源

如果要建立新資源,您必須傳送 POST 要求到資源端點,亦即 UsersGroups。POST 內容必須含有使用者 json 物件,且 HTTP 標頭的內容類型必須設為 application/json
註: 不支援 application/xml 內容類型。
如果要建立使用者,必須將下列要求公佈到 https://localhost:9090/ibm/api/scim/Users Content-Type
Content-Type: application/json
Content-Length: ...

{
  "schemas":["urn:scim:schemas:core:1.0"],
  "userName":"bjensen",
  "externalId": "uid=bjensen,o=ibm,c=us",
  "name":{
    "familyName":"Jensen",
    "givenName":"Barbara"
  }
}

要求必須包含在使用者登錄中順利建立使用者或群組所需的所有屬性。例如,在後端 Tivoli Directory Server LDAP 中,建立使用者所需的一組最基本 LDAP 屬性是 uid, sn, and cn;因此在任何的建立使用者要求中,都必須包含 userNamegivenNamefamilyName。只要使用者登錄中有任何的綱目違規,建立作業就會失敗。

externalId 屬性形同 ID,且必須指定。屬性格式取決於後端使用者登錄的規格。以上述範例來說,後端是 LDAP 伺服器,其 baseEntry 是 o=ibm,c=us,使用者的 RDN 內容是設為 UID,因此 externalId 變成 uid=bjensen,o=ibm,c=us

根據建立要求,傳回所建立的使用者物件。
{
    "schemas":["urn:scim:schemas:core:1.0"],
    "id":"uid=bjensen,o=ibm,c=us",
    "userName":"bjensen",
    "externalId":"uid=bjensen,o=ibm,c=us",
    "name":{
          "formatted":"Barbara Jensen",
          "familyName":"Jensen",
          "givenName":"Barbara"
    },
    "meta":{
         "lastModified":"2015-09-15T14:30:11",        "location":"https:\\localhost:9090\ibm\api\scim\Users\uid=bjensen,o=ibm,c=us",
         "created":"2015-09-15T14:30:11"
    }
}
如果配置多個 LDAP,並且需要呼叫建立作業,則必須定義實體的預設母項。所定義的母項會指定基本項目,以作為建立新實體的基礎。下列範例顯示 PersonAccount 預設母項的配置。
<federatedRepository>
    <primaryRealm name="WIMRegistry">
        <participatingBaseEntry name="o=ibm,c=us"/>
        <participatingBaseEntry name="o=ldap"/>
    	</primaryRealm>
    <supportedEntityType>
        <defaultParent>o=ldap</defaultParent>
        <name>PersonAccount</name>
    </supportedEntityType>
</federatedRepository>

修改資源

如果要修改資源,則需要傳送 PUT 要求至資源端點,亦即 /Users/Groups。PUT 要求會執行完整的資源更新。凡未指定在輸入中的屬性都會刪除。
註: 不支援使用 PATCH 進行局部更新。
如果要修改先前建立的資源,必須將下列要求公佈到 https://localhost:9090/ibm/api/scim/Users/uid=bjensen,o=ibm,c=us
Content-Type: application/json
Content-Length: ...

{
  "schemas":["urn:scim:schemas:core:1.0"],
  "userName":"bjensen",
  "externalId":"uid=bjensen,o=ibm,c=us",
  "name":{
    "familyName":"Jensen",
    "givenName":"Barb"
  }
}
此要求是將物件的名字從 Barbara 修改為 Barb。URL 中指定的 ID 必須符合使用者物件中指定的 externalId
如果要修改群組 cn=employeeGroup,o=ibm,c=us,並變更群組的成員資格,則需要指定成員屬性。
Content-Type: application/json
Content-Length: ...
{
    "id":"cn=employeeGroup,o=ibm,c=us",
    "schemas":["urn:scim:schemas:core:1.0"],
    "displayName":"employeeGroup",
    "externalId":"cn=employeeGroup,o=ibm,c=us",
    "members":[{"value":"uid=bjensen,o=ibm,c=us", "type":"User"},{"value":"cn=consultants,o=ibm,c=us", "type":"Group"}]
}
如果要修改群組 cn=employeeGroup,o=ibm,c=us,並將所有成員從群組移除,則需要指定空白的成員屬性。
Content-Type: application/json
Content-Length: ...
{
    "id":"cn=employeeGroup,o=ibm,c=us",
    "schemas":["urn:scim:schemas:core:1.0"],
    "displayName":"employeeGroup",
    "externalId":"cn=employeeGroup,o=ibm,c=us",
    "members":[]
}

刪除資源

如果要刪除資源,則需要傳送 DELETE 要求至資源端點,亦即 /Users/Groups。例如,如果要刪除上述範例中所建立的使用者 uid=bjensen,o=ibm,c=us,請傳送要求至 https://localhost:9090/ibm/api/scim/Users/uid=bjensen,o=ibm,c=us
註: SCIM 只在 Java 7 或更新版本上執行。

指示主題類型的圖示 參照主題



「時間戳記」圖示 前次更新: 2016 年 11 月 30 日
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=rwlp_sec_scim_operations
檔名:rwlp_sec_scim_operations.html