在 Azure AD 中建立企業應用程式
1. 在 Azure AD 入口網站的 Azure Active Directory 選單中,選取 Enterprise applications 選項。
2. 在右側開啟的頁面中,按一下 New application
3. Browse Azure AD Gallery (Preview) 頁中,按一下 Create your own application
4. 輸入應用程式的名稱,選取 Integrate any other application you don't find in the gallery,然後按一下 Create
5. Overview 頁中,按一下 Set up a single sign on
6. Select a single sign-on method 畫面中,選取 SAML 選項。即會開啟具有編號步驟的 Set up Single Sign-On with SAML 頁。在以下各部份中,完成詳細步驟。
步驟 1 - 基本 SAML 組態 
1. 在步驟 1 中,針對 Basic SAML Configuration,按一下 Edit
2. Basic SAML Configuration 中,輸入下列資訊:
Indentifier (Entity ID) - 將作為 sso-settings.json 檔案的 BasicSettings 元件中 metadataEntityId 的值使用。
Reply URL (Assertion Consumer Service URL) - 應使用下列格式:
https:/<ThingWorx FQDN>:<埠>/Thingworx/saml/SSO
3. 按一下 Save,然後關閉 Basic SAML Configuration。當系統提示您測試單一登入時,選取 No, I'll test later
即會重新顯示 Set up Single Sign-On with SAML 步驟,並輸入 IdentifierReply URL 值。
步驟 2 - 使用者屬性與宣告 
1. 在步驟 2 中針對 User Attributes & Claims 按一下 Edit
2. User Attributes & Claims 中,按一下 Add new claim
3. Manage claim 頁中,輸入下列資訊:
Name - 輸入 UID。
Source - 選取 Tranformation 選項。Manage transformation 快顯視窗即會開啟。
4. Manage transformation 視窗中,輸入下列資訊,如下圖所示:
Transformation - StartWith()
Paramter 1 (Input) - user.userprincipalname
Value - Administrator@
Parameter 2 (Output) - "Administrator"
Specify output if no match - 選取核取方塊。
Parameter 3 (Output if no match) - user.userprincipalname
5. 按一下 Add
6. 按一下 Save 並關閉 Manage Claim 視窗。當系統提示您測試單一登入時,選取 No, I'll test later
User Attributes & Claims 步驟會以您剛剛輸入的值重新顯示。
步驟 3 - SAML 簽署憑證 
1. 在步驟 3 中,針對 SAML Signing Certificate 下載 Certificate (Raw),這是 Azure AD 公開憑證。
2. 下載 Federation Metadata XML。下載檔案時,請將其重新命名為 sso-idp-metadata.xml
這是否有幫助?