共用方式為


同盟驗證裝置註冊

本節提供使用同盟驗證原則的行動裝置註冊通訊協定範例。 當驗證原則設定為 Federated 時,註冊用戶端會使用 Web 驗證代理人來取得安全性令牌。 註冊用戶端會在回應消息內呼叫 Web 驗證代理人 API 來啟動程式。 伺服器應該建置 Web 驗證代理人頁面以符合裝置畫面,而且應該與現有的註冊 UI 一致。 在用戶端憑證要求呼叫期間,註冊用戶端會使用從訊息代理程式傳回為結束頁面的不透明安全性令牌作為裝置安全性密碼。

探索 <AuthenticationServiceURL> 回應消息指定 Web 驗證代理人頁面起始 URL 的專案。

如需適用於 Windows 的 Microsoft 行動裝置註冊通訊協定的詳細資訊,請 參閱 [MS-MDE2]:行動裝置註冊通訊協定第 2 版

注意

如需 Windows 不支援的註冊案例清單,請參閱 不支持的註冊案例

探索服務

探索 Web 服務提供使用者向管理服務註冊電話所需的設定資訊。 此服務是透過 HTTPS 的靜態 Web 服務, (僅) 伺服器驗證。

注意

探索服務的系統管理員必須建立位址為的 enterpriseenrollment.<domain_name>.com主機。

裝置的自動探索流程會使用在登入期間提交至 [工作場所設定] 畫面的電子郵件位址功能變數名稱。 自動探索系統會建構使用此主機名的 URI,方法是將子域 企業註冊 附加至電子郵件地址的網域,並附加路徑 /EnrollmentServer/Discovery.svc。 例如,如果電子郵件位址是 sample@contoso.com,則第一個 Get 要求產生的 URI 會是: http://enterpriseenrollment.contoso.com/EnrollmentServer/Discovery.svc

第一個要求是標準 HTTP GET 要求。

下列範例顯示透過 HTTP GET 對指定 user@contoso.com 為電子郵件位址之探索伺服器的要求。

Request Full Url: http://EnterpriseEnrollment.contoso.com/EnrollmentServer/Discovery.svc
Content Type: unknown
Header Byte Count: 153
Body Byte Count: 0
GET /EnrollmentServer/Discovery.svc HTTP/1.1
User-Agent: Windows Phone 8 Enrollment Client
Host: EnterpriseEnrollment.contoso.com
Pragma: no-cache
Request Full Url: http://EnterpriseEnrollment.contoso.com/EnrollmentServer/Discovery.svc
Content Type: text/html
Header Byte Count: 248
Body Byte Count: 0
HTTP/1.1 200 OK
Connection: Keep-Alive
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 0

裝置從伺服器取得回應之後,裝置會將 POST 要求傳送至 enterpriseenrollment.<domain_name>/EnrollmentServer/Discovery.svc。 從伺服器 (取得另一個回應之後,應該會告訴裝置註冊伺服器) 的位置,從裝置傳送的下一則訊息是到 enterpriseenrollment.<domain_name> 註冊伺服器。

套用下列邏輯:

  1. 裝置會先嘗試 HTTPS。 如果裝置不信任伺服器憑證,則 HTTPS 嘗試會失敗。
  2. 如果失敗,裝置會嘗試使用 HTTP 來查看是否已重新導向:
    • 如果裝置未重新導向,系統會提示使用者輸入伺服器位址。
    • 如果裝置已重新導向,系統會提示用戶允許重新導向。

下列範例示範透過 HTTP POST 命令對指定 user@contoso.com 為電子郵件位址的探索 Web 服務提出的要求

https://EnterpriseEnrollment.Contoso.com/EnrollmentServer/Discovery.svc

下列範例顯示探索服務要求。

<?xml version="1.0"?>
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing"
    xmlns:s="http://www.w3.org/2003/05/soap-envelope">
    <s:Header>
        <a:Action s:mustUnderstand="1">
            http://schemas.microsoft.com/windows/management/2012/01/enrollment/IDiscoveryService/Discover
        </a:Action>
        <a:MessageID>urn:uuid: 748132ec-a575-4329-b01b-6171a9cf8478</a:MessageID>
        <a:ReplyTo>
            <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
        </a:ReplyTo>
        <a:To s:mustUnderstand="1">
            https://ENROLLTEST.CONTOSO.COM/EnrollmentServer/Discovery.svc
        </a:To>
    </s:Header>
    <s:Body>
        <Discover xmlns="http://schemas.microsoft.com/windows/management/2012/01/enrollment/">
            <request xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                <EmailAddress>user@contoso.com</EmailAddress>
                <OSEdition>3</OSEdition>
                <!-- New -->
                <RequestVersion>3.0</RequestVersion>
                <!-- Updated -->
                <DeviceType>WindowsPhone</DeviceType>
                <!-- Updated -->
                <ApplicationVersion>10.0.0.0</ApplicationVersion>
                <AuthPolicies>
                    <AuthPolicy>OnPremise</AuthPolicy>
                    <AuthPolicy>Federated</AuthPolicy>
                </AuthPolicies>
            </request>
        </Discover>
    </s:Body>
</s:Envelope>

探索回應是 XML 格式,並包含下列欄位:

  • EnrollmentServiceUrl (註冊服務 URL) - 指定由管理服務公開之註冊端點的 URL。 裝置應該在用戶經過驗證之後呼叫此 URL。 此欄位為必要欄位。
  • 驗證原則 (AuthPolicy) - 指出需要哪種類型的驗證。 對於 MDM 伺服器,OnPremise 是支援的值,這表示呼叫管理服務 URL 時會驗證使用者。 此欄位為必要欄位。
  • 在 Windows 中,同盟會新增為另一個支援的值。 這項新增功能可讓伺服器使用 Web 驗證代理人來執行自定義的使用者驗證,以及接受使用期限。

注意

HTTP 伺服器回應不得將 Transfer-Encoding 設定為 Chunked;它必須以一個訊息傳送。

當驗證原則設定為同盟時,註冊用戶端會使用 Web 驗證代理人 (WAB) 來取得安全性令牌。 WAB 起始頁 URL 是由回應消息中的探索服務所提供。 註冊用戶端會在回應消息內呼叫WAB API,以啟動WAB程式。 WAB 頁面是伺服器裝載的網頁。 伺服器應該建置這些頁面,以適當地容納裝置畫面,並且盡可能與 MDM 註冊 UI 中的其他組建保持一致。 在用戶端憑證註冊要求呼叫期間,註冊用戶端會使用從WAB傳回為端點的不透明安全性令牌作為裝置安全性密碼。

注意

請使用下列指引,而不是依賴在驗證期間傳遞的使用者代理程式字串來取得作業系統版本等資訊:

  • 從探索要求期間傳送的數據剖析OS版本。
  • 將 OS 版本附加為 AuthenticationServiceURL 中的參數。
  • 當 OS 傳送驗證的回應時,從 AuthenticiationServiceURL 剖析 OS 版本。

DiscoveryResponse XML 中引進了新的 XML 標記 AuthenticationServiceUrl,可讓伺服器指定 WAB 頁面的起始 URL。 針對同盟驗證,此 XML 標記必須存在。

注意

註冊客戶端與驗證和傳回安全性令牌的通訊協定流程無關。 雖然伺服器可能會直接提示輸入使用者認證,或輸入與另一個伺服器和目錄服務的同盟通訊協定,但註冊用戶端與所有這一切無關。 若要保持無從驗證,與涉及註冊用戶端之驗證相關的所有通訊協定流程都是被動的,也就是瀏覽器實作。

以下是伺服器的明確需求。

  • 元素 <DiscoveryResponse>``<AuthenticationServiceUrl> 必須支援 HTTPS。
  • 驗證伺服器必須使用裝置受信任的跟證書。 否則,WAP 呼叫會失敗。
  • WP 在 WAB 驗證期間不支援 ADFS 的 Windows 整合式驗證 (WIA) 。 如果使用ADFS 2012 R2,則必須設定為不嘗試適用於Windows裝置的 WIA。

註冊客戶端會發出 HTTPS 要求,如下所示:

AuthenticationServiceUrl?appru=<appid>&amp;login_hint=<User Principal Name>
  • <appid> 是表單 ms-app://string
  • <User Principal Name> 是註冊用戶的名稱,例如, user@constoso.com 作為註冊登入頁面中用戶的輸入。 這個屬性的值可做為驗證伺服器用來作為驗證一部分的提示。

驗證完成之後,驗證伺服器應該會傳回 HTML 窗體檔,並在查詢字串參數中識別 appid 的 POST 方法動作。

注意

若要讓應用程式與嚴格的內容安全策略相容,通常必須對 HTML 範本和用戶端程式代碼進行一些變更、新增原則標頭,並測試一旦部署原則后一切運作正常。

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding
Content-Length: 556

<!DOCTYPE>
<html>
   <head>
      <title>Working...</title>
      <script>
         function formSubmit() {
            document.forms[0].submit();
         }
           window.onload=formSubmit;
      </script>
   </head>
   <body>
    <!-- appid below in post command must be same as appid in previous client https request. -->
      <form method="post" action="ms-app://appid">
         <p><input type="hidden" name="wresult" value="token value"/></p>
         <input type="submit"/>
      </form>
   </body>
</html>

伺服器必須將 POST 傳送至表單 ms-app://string 的重新導向 URL, (URL 配置為 ms-app) ,如 POST 方法動作中所示。 安全性令牌值是 EncodingType 屬性中包含的 <wsse:BinarySecurityToken> base64 編碼字串http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\#base64binary。 Windows 會在將二進位編碼傳送回註冊伺服器時執行二進位編碼,其格式為僅限 HTML 編碼。 此字串對註冊用戶端是不透明的;用戶端不會解譯字串。

下列範例顯示從探索 Web 服務收到的回應,該服務需要透過WAB 進行驗證。

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
    xmlns:a="http://www.w3.org/2005/08/addressing">
    <s:Header>
        <a:Action s:mustUnderstand="1">
            http://schemas.microsoft.com/windows/management/2012/01/enrollment/IDiscoveryService/DiscoverResponse
        </a:Action>
        <ActivityId>
            d9eb2fdd-e38a-46ee-bd93-aea9dc86a3b8
        </ActivityId>
        <a:RelatesTo>urn:uuid: 748132ec-a575-4329-b01b-6171a9cf8478</a:RelatesTo>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <DiscoverResponse xmlns="http://schemas.microsoft.com/windows/management/2012/01/enrollment">
            <DiscoverResult>
                <AuthPolicy>Federated</AuthPolicy>
                <EnrollmentVersion>3.0</EnrollmentVersion>
                <EnrollmentPolicyServiceUrl>
                    https://enrolltest.contoso.com/ENROLLMENTSERVER/DEVICEENROLLMENTWEBSERVICE.SVC
                </EnrollmentPolicyServiceUrl>
                <EnrollmentServiceUrl>
                    https://enrolltest.contoso.com/ENROLLMENTSERVER/DEVICEENROLLMENTWEBSERVICE.SVC
                </EnrollmentServiceUrl>
                <AuthenticationServiceUrl>
                    https://portal.manage.contoso.com/LoginRedirect.aspx
                </AuthenticationServiceUrl>
            </DiscoverResult>
        </DiscoverResponse>
    </s:Body>
</s:Envelope>

註冊原則 Web 服務

原則服務是選擇性的。 根據預設,如果未指定任何原則,則密鑰長度下限為 2k,而哈希演算法為 SHA-1。

此 Web 服務會實作 X.509 憑證註冊原則通訊協定 (MS-XCEP) 規格,允許自定義憑證註冊以符合不同時間的企業安全性需求, (密碼編譯靈活度) 。 服務會處理來自用戶端的 GetPolicies 訊息、驗證用戶端,並在 GetPoliciesResponse 訊息中傳回相符的註冊原則。

針對同盟驗證原則,安全性令牌認證會在使用 <wsse:BinarySecurityToken> 專案 [WSS] 的要求訊息中提供。 系統會擷取安全性令牌,如探索響應一節中所述。 驗證資訊如下所示:

  • wsse:Security:註冊用戶端會實作 <wsse:Security> [WSS] 第 5 節中定義的專案。 項目 <wsse:Security> 必須是 專案的子 <s:Header> 系。
  • wsse:BinarySecurityToken:註冊用戶端會 <wsse:BinarySecurityToken> 實作 [WSS] 第 6.3 節中定義的專案。 項目 <wsse:BinarySecurityToken> 必須包含為 SOAP 標頭中 專案的子 <wsse:Security> 系。

如探索回應一節所述,包含<wsse:BinarySecurityToken>專案對註冊用戶端是不透明的,而且用戶端不會解譯字串,而且安全性令牌驗證伺服器 (會同意包含專案,如 和 Enterprise Server 元素中<AuthenticationServiceUrl><DiscoveryResponse>所識別。

元素 <wsse:BinarySecurityToken> 包含base64編碼的字串。 註冊用戶端會使用從驗證伺服器收到的安全性令牌,並以base64編碼令牌來填入 <wsse:BinarySecurityToken> 專案。

  • wsse:BinarySecurityToken/attributes/ValueType: <wsse:BinarySecurityToken> ValueType 屬性必須是 http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken

  • wsse:BinarySecurityToken/attributes/EncodingType: <wsse:BinarySecurityToken> EncodingType 屬性必須是 http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\#base64binary

下列範例是具有已接收安全性令牌做為客戶端認證的註冊原則要求。

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
    xmlns:a="http://www.w3.org/2005/08/addressing"
    xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512"
    xmlns:ac="http://schemas.xmlsoap.org/ws/2006/12/authorization">
    <s:Header>
        <a:Action s:mustUnderstand="1">
            http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy/IPolicy/GetPolicies
        </a:Action>
        <a:MessageID>urn:uuid:72048B64-0F19-448F-8C2E-B4C661860AA0</a:MessageID>
        <a:ReplyTo>
            <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
        </a:ReplyTo>
        <a:To s:mustUnderstand="1">
             https://enrolltest.contoso.com/ENROLLMENTSERVER/DEVICEENROLLMENTWEBSERVICE.SVC
        </a:To>
        <wsse:Security s:mustUnderstand="1">
            <wsse:BinarySecurityToken ValueType="http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary"
                xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                B64EncodedSampleBinarySecurityToken
            </wsse:BinarySecurityToken>
        </wsse:Security>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <GetPolicies xmlns="http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy">
            <client>
                <lastUpdate xsi:nil="true"/>
                <preferredLanguage xsi:nil="true"/>
            </client>
            <requestFilter xsi:nil="true"/>
        </GetPolicies>
    </s:Body>
</s:Envelope>

驗證用戶之後,Web 服務會擷取用戶應該註冊的證書範本,並根據證書範本屬性建立註冊原則。 您可以在 MSDN 上找到回應的範例。

MS-XCEP 支援使用各種複雜類型和屬性的彈性註冊原則。 針對 Windows 裝置,我們將先支援 minimalKeyLength、hashAlgorithmOIDReference 原則和 CryptoProviders。 hashAlgorithmOIDReference 在 GetPolicesResponse 中有相關的 OID 和 OIDReferenceID 和 policySchema。 policySchema 指的是證書範本版本。 MS-XCEP 第 3 版支援哈希演算法。

注意

HTTP 伺服器回應不得將 Transfer-Encoding 設定為 Chunked;它必須以一個訊息傳送。

下列代碼段顯示原則 Web 服務回應。

<s:Envelope
   xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
   xmlns:s="http://www.w3.org/2003/05/soap-envelope"
   xmlns:a="http://www.w3.org/2005/08/addressing">
  <s:Header>
    <a:Action s:mustUnderstand="1">
      http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy/IPolicy/GetPoliciesResponse
    </a:Action>
    <a:RelatesTo>urn:uuid: 69960163-adad-4a72-82d2-bb0e5cff5598</a:RelatesTo>
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <GetPoliciesResponse
       xmlns="http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy">
      <response>
      <policyID />
        <policyFriendlyName xsi:nil="true"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
        <nextUpdateHours xsi:nil="true"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
        <policiesNotChanged xsi:nil="true"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
        <policies>
          <policy>
            <policyOIDReference>0</policyOIDReference>
            <cAs xsi:nil="true" />
            <attributes>
              <commonName>CEPUnitTest</commonName>
              <policySchema>3</policySchema>
              <certificateValidity>
                <validityPeriodSeconds>1209600</validityPeriodSeconds>
                <renewalPeriodSeconds>172800</renewalPeriodSeconds>
              </certificateValidity>
              <permission>
                <enroll>true</enroll>
                <autoEnroll>false</autoEnroll>
              </permission>
              <privateKeyAttributes>
                <minimalKeyLength>2048</minimalKeyLength>
                <keySpec xsi:nil="true" />
                <keyUsageProperty xsi:nil="true" />
                <permissions xsi:nil="true" />
                <algorithmOIDReference xsi:nil="true" />
                <cryptoProviders xsi:nil="true" />
              </privateKeyAttributes>
              <revision>
                <majorRevision>101</majorRevision>
                <minorRevision>0</minorRevision>
              </revision>
              <supersededPolicies xsi:nil="true" />
              <privateKeyFlags xsi:nil="true" />
              <subjectNameFlags xsi:nil="true" />
              <enrollmentFlags xsi:nil="true" />
              <generalFlags xsi:nil="true" />
              <hashAlgorithmOIDReference>0</hashAlgorithmOIDReference>
              <rARequirements xsi:nil="true" />
              <keyArchivalAttributes xsi:nil="true" />
              <extensions xsi:nil="true" />
            </attributes>
          </policy>
        </policies>
      </response>
      <cAs xsi:nil="true" />
      <oIDs>
        <oID>
          <value>1.3.14.3.2.29</value>
          <group>1</group>
          <oIDReferenceID>0</oIDReferenceID>
          <defaultName>szOID_OIWSEC_sha1RSASign</defaultName>
        </oID>
      </oIDs>
    </GetPoliciesResponse>
  </s:Body>
</s:Envelope>

註冊 Web 服務

此 Web 服務會實作 MS-WSTEP 通訊協定。 它會處理來自用戶端的 RequestSecurityToken (RST) 訊息、驗證用戶端、向 CA 要求憑證,然後在 RequestSecurityTokenResponse (RSTR) 中將它傳回給用戶端。 除了發行的憑證之外,回應也包含布建 DM 用戶端所需的設定。

(RST) 的 RequestSecurityToken 必須具有使用者認證和憑證要求。 RST SOAP 信封中的用戶認證與 GetPolicies 中的認證相同,而且可能會根據驗證原則是 OnPremise 或 Federated 而有所不同。 RST SOAP 主體中的 BinarySecurityToken 包含 Base64 編碼的 PKCS#10 憑證要求,由客戶端根據註冊原則產生。 用戶端可能已使用 MS-XCEP 要求註冊原則,然後才使用 MS-WSTEP 要求憑證。 如果證書頒發機構單位 (CA 接受 PKCS#10 憑證要求,) (密鑰長度、哈希演算法等,符合憑證範本) ,用戶端就可以成功註冊。

RequestSecurityToken 會使用自定義 TokenType (http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentToken) ,因為我們的註冊令牌超過 X.509 v3 憑證。 如需詳細資訊,請參閱回應一節。

RST 也可以指定許多 AdditionalContext 專案,例如 DeviceType 和 Version。 例如,根據這些值,Web 服務可以傳回裝置特定和版本特定的 DM 設定。

注意

原則服務和註冊服務必須位於相同的伺服器上;也就是說,它們必須具有相同的主機名。

下列範例顯示同盟驗證的註冊 Web 服務要求。

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
   xmlns:a="http://www.w3.org/2005/08/addressing"
   xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
   xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
   xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512"
   xmlns:ac="http://schemas.xmlsoap.org/ws/2006/12/authorization">
  <s:Header>
    <a:Action s:mustUnderstand="1">
      http://schemas.microsoft.com/windows/pki/2009/01/enrollment/RST/wstep
    </a:Action>
    <a:MessageID>urn:uuid:0d5a1441-5891-453b-becf-a2e5f6ea3749</a:MessageID>
    <a:ReplyTo>
      <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
    </a:ReplyTo>
    <a:To s:mustUnderstand="1">
      https://enrolltest.contoso.com:443/ENROLLMENTSERVER/DEVICEENROLLMENTWEBSERVICE.SVC
    </a:To>
    <wsse:Security s:mustUnderstand="1">
      <wsse:BinarySecurityToken
         wsse:ValueType="http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken"
         wsse:EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary">
      B64EncodedSampleBinarySecurityToken
      </wsse:BinarySecurityToken>
    </wsse:Security>
  </s:Header>
  <s:Body>
    <wst:RequestSecurityToken>
      <wst:TokenType>
        http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentToken
      </wst:TokenType>
      <wst:RequestType>
        http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue
      </wst:RequestType>
      <wsse:BinarySecurityToken
         ValueType="http://schemas.microsoft.com/windows/pki/2009/01/enrollment#PKCS10"
         EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary">
        DER format PKCS#10 certificate request in Base64 encoding Insterted Here
      </wsse:BinarySecurityToken>
      <ac:AdditionalContext xmlns="http://schemas.xmlsoap.org/ws/2006/12/authorization">
           <ac:ContextItem Name="OSEdition">
               <ac:Value> 4</ac:Value>
            </ac:ContextItem>
            <ac:ContextItem Name="OSVersion">
               <ac:Value>10.0.9999.0</ac:Value>
            </ac:ContextItem>
            <ac:ContextItem Name="DeviceName">
               <ac:Value>MY_WINDOWS_DEVICE</ac:Value>
            </ac:ContextItem>
            <ac:ContextItem Name="MAC">
               <ac:Value>FF:FF:FF:FF:FF:FF</ac:Value>
            </ac:ContextItem>
            <ac:ContextItem Name="MAC">
               <ac:Value>CC:CC:CC:CC:CC:CC</ac:Value>
            <ac:ContextItem Name="IMEI">
               <ac:Value>49015420323756</ac:Value>
            </ac:ContextItem>
            <ac:ContextItem Name="IMEI">
               <ac:Value>30215420323756</ac:Value>
            </ac:ContextItem>
            <ac:ContextItem Name="EnrollmentType">
               <ac:Value>Full</ac:Value>
            </ac:ContextItem>
            <ac:ContextItem Name="DeviceType">
               <ac:Value>CIMClient_Windows</ac:Value>
            </ac:ContextItem>
            <ac:ContextItem Name="ApplicationVersion">
               <ac:Value>10.0.9999.0</ac:Value>
            </ac:ContextItem>
            <ac:ContextItem Name="DeviceID">
               <ac:Value>7BA748C8-703E-4DF2-A74A-92984117346A</ac:Value>
            </ac:ContextItem>
            <ac:ContextItem Name="TargetedUserLoggedIn">
               <ac:Value>True</ac:Value>
            </ac:ContextItem>
         </ac:AdditionalContext>
    </wst:RequestSecurityToken>
  </s:Body>
</s:Envelope>

驗證要求之後,Web 服務會查閱指派的用戶端證書範本、視需要加以更新、將 PKCS#10 要求傳送至 CA、處理來自 CA 的回應、建構 OMA 用戶端布建 XML 格式,然後在 RequestSecurityTokenResponse (RSTR) 中傳回它。

注意

HTTP 伺服器回應不得將 Transfer-Encoding 設定為 Chunked;它必須以一個訊息傳送。

與 RST 中的 TokenType 類似,RSTR 會使用 BinarySecurityToken () http://schemas.microsoft.com/ConfigurationManager/Enrollment/DeviceEnrollmentProvisionDoc 中的自定義 ValueType,因為令牌大於 X.509 v3 憑證。

佈建 XML 包含:

  • 要求的憑證 (必要)
  • 需要 DM 用戶端設定 ()

如果有的話,用戶端會安裝客戶端憑證、企業跟證書和中繼 CA 憑證。 DM 組態包含 DM 伺服器的名稱和位址、要使用的用戶端憑證,以及 DM 用戶端回呼伺服器時的排程。

註冊布建 XML 最多應包含一個跟證書,以及鏈結 MDM 用戶端憑證所需的一個中繼 CA 憑證。 您可以在 OMA DM 會話期間布建更多根和中繼 CA 憑證。

布建根和中繼 CA 憑證時,支援的 CSP 節點路徑為:用於跟證書布建的 CertificateStore/Root/System、用於中繼 CA 憑證布建的 CertificateStore/My/User。

以下是 RSTR 訊息範例,以及 RSTR 內 OMA 用戶端布建 XML 的範例。 如需布建 XML 時所使用 (CSP) 設定服務提供者的詳細資訊,請參閱企業設定、原則和應用程式管理一節。

下列範例顯示註冊 Web 服務回應。

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:a="http://www.w3.org/2005/08/addressing"
   xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <s:Header>
      <a:Action s:mustUnderstand="1" >
         http://schemas.microsoft.com/windows/pki/2009/01/enrollment/RSTRC/wstep
      </a:Action>
      <a:RelatesTo>urn:uuid:81a5419a-496b-474f-a627-5cdd33eed8ab</a:RelatesTo>
      <o:Security s:mustUnderstand="1" xmlns:o=
         "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <u:Timestamp u:Id="_0">
            <u:Created>2012-08-02T00:32:59.420Z</u:Created>
            <u:Expires>2012-08-02T00:37:59.420Z</u:Expires>
         </u:Timestamp>
      </o:Security>
   </s:Header>
   <s:Body>
      <RequestSecurityTokenResponseCollection
         xmlns="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
         <RequestSecurityTokenResponse>
            <TokenType>
                http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentToken
            </TokenType>
             <DispositionMessage xmlns="http://schemas.microsoft.com/windows/pki/2009/01/enrollment"/>
             <RequestedSecurityToken>
               <BinarySecurityToken
                  ValueType="http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentProvisionDoc"
                  EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary"
                  xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                  B64EncodedSampleBinarySecurityToken
               </BinarySecurityToken>
            </RequestedSecurityToken>
            <RequestID xmlns="http://schemas.microsoft.com/windows/pki/2009/01/enrollment">0</RequestID>
         </RequestSecurityTokenResponse>
      </RequestSecurityTokenResponseCollection>
   </s:Body>
</s:Envelope>

下列程式代碼顯示先前套件中呈現的範例布建 XML (作為安全性令牌) :

<wap-provisioningdoc version="1.1">
   <characteristic type="CertificateStore">
      <characteristic type="Root">
         <characteristic type="System">
            <characteristic type="Encoded Root Cert Hash Inserted Here">
               <parm name="EncodedCertificate" value="B64 encoded cert insert here" />
            </characteristic>
         </characteristic>
      </characteristic>
   </characteristic>
   <characteristic type="CertificateStore">
      <characteristic type="My" >
         <characteristic type="User">
            <characteristic type="Encoded Root Cert Hash Inserted Here">
               <parm name="EncodedCertificate" value="B64EncodedCertInsertedHere" />
            </characteristic>
            <characteristic type="PrivateKeyContainer"/>
            <!-- This tag must be present for XML syntax correctness. -->
         </characteristic>
         <characteristic type="WSTEP">
            <characteristic type="Renew">
               <!-If the datatype for ROBOSupport, RenewPeriod, and RetryInterval tags exist, they must be set explicitly. -->
               <parm name="ROBOSupport" value="true" datatype="boolean"/>
               <parm name="RenewPeriod" value="60" datatype="integer"/>
               <parm name="RetryInterval" value="4" datatype="integer"/>
            </characteristic>
         </characteristic>
      </characteristic>
   </characteristic>
   <characteristic type="APPLICATION">
      <parm name="APPID" value="w7"/>
      <parm name="PROVIDER-ID" value="TestMDMServer"/>
      <parm name="NAME" value="Microsoft"/>
      <parm name="ADDR" value="https://DM.contoso.com:443/omadm/Windows.ashx"/>
      <parm name="CONNRETRYFREQ" value="6" />
      <parm name="INITIALBACKOFFTIME" value="30000" />
      <parm name="MAXBACKOFFTIME" value="120000" />
      <parm name="BACKCOMPATRETRYDISABLED" />
      <parm name="DEFAULTENCODING" value="application/vnd.syncml.dm+wbxml" />
      <parm name="SSLCLIENTCERTSEARCHCRITERIA" value="Subject=DC%3dcom%2cDC%3dmicrosoft%2cCN%3dUsers%2cCN%3dAdministrator&amp;amp;Stores=My%5CUser"/>
      <characteristic type="APPAUTH">
         <parm name="AAUTHLEVEL" value="CLIENT"/>
         <parm name="AAUTHTYPE" value="DIGEST"/>
         <parm name="AAUTHSECRET" value="password1"/>
         <parm name="AAUTHDATA" value="B64encodedBinaryNonceInsertedHere"/>
      </characteristic>
      <characteristic type="APPAUTH">
         <parm name="AAUTHLEVEL" value="APPSRV"/>
         <parm name="AAUTHTYPE" value="BASIC"/>
         <parm name="AAUTHNAME" value="testclient"/>
         <parm name="AAUTHSECRET" value="password2"/>
      </characteristic>
   </characteristic>
   <characteristic type="DMClient"> <!-- In Windows 10, an enrollment server should use DMClient CSP XML to configure DM polling schedules. -->
      <characteristic type="Provider">
        <!-- ProviderID in DMClient CSP must match to PROVIDER-ID in w7 APPLICATION characteristics -->
        <characteristic type="TestMDMServer">
            <parm name="UPN" value="UserPrincipalName@contoso.com" datatype="string" />
            <parm name="EntDeviceName" value="Administrator_Windows" datatype="string" />
            <characteristic type="Poll">
                <parm name="NumberOfFirstRetries" value="8" datatype="integer" />
                <parm name="IntervalForFirstSetOfRetries" value="15" datatype="integer" />
                <parm name="NumberOfSecondRetries" value="5" datatype="integer" />
                <parm name="IntervalForSecondSetOfRetries" value="3" datatype="integer" />
                <parm name="NumberOfRemainingScheduledRetries" value="0" datatype="integer" />
                <!-- Windows 10 supports MDM push for real-time communication. The DM client long term polling schedule's retry waiting interval should be more than 24 hours (1440) to reduce the impact to data consumption and battery life. Refer to the DMClient Configuration Service Provider section for information about polling schedule parameters.-->
                <parm name="IntervalForRemainingScheduledRetries" value="1560" datatype="integer" />
                <parm name="PollOnLogin" value="true" datatype="boolean" />
            </characteristic>
        </characteristic>
      </characteristic>
   </characteristic>
   <!-- For Windows 10, we removed EnterpriseAppManagement from the enrollment protocol. -->
</wap-provisioningdoc>

注意

  • <Parm name> w7 APPLICATION CSP XML 中的 和 <characteristic type=> 元素會區分大小寫,且必須全部大寫。

  • 在 w7 APPLICATION 特性中,應該在 XML 中提供 CLIENT 和 APPSRV 認證。

  • Detailed descriptions of these settings are located in the Enterprise settings, policies and app management section of this document.

  • PrivateKeyContainer 特性是必要的,而且必須出現在註冊布建 XML 中。 其他重要的設定是 PROVIDER-IDNAMEADDR 參數元素,這些元素必須包含 DM 提供者的唯一標識符和名稱,以及裝置可以連線以進行組態布建的位址。 標識碼和 NAME 可以是任意值,但必須是唯一的。

  • SSLCLIENTCERTSEARCHCRITERIA 也很重要,可用來選取要用於客戶端驗證的憑證。 搜尋是以已簽署用戶憑證的主體屬性為基礎。

  • CertificateStore/WSTEP 會啟用憑證更新。 如果伺服器不支援,請勿加以設定。