更新 Windchill 組態檔案
必須編輯兩個 Windchill 檔案 -
securityContext.properties 檔案和
Web.xml 檔案,才能在 Windchill 中啟用 OAuth。如需詳細資訊,請參閱
配置 OAuth 委派授權。
1. 透過 site.xconf 公用程式更新 securityContext.properties 檔案中的內容。
◦ wt.oauth2.token.userNameAttribute
◦ wt.oauth2.token.tokenType
◦ wt.oauth2.token.scopeAttribute
2. 透過 site.xconf 公用程式在 wt.properties 檔案中新增下列內容。
◦ wt.jwt.oauth2.token.issueAtTime
◦ wt.jwt.oauth2.token.azure.tenantId
◦ wt.jwt.oauth2.token.audience
◦ wt.jwt.oauth2.token.tokenIssuer
◦ wt.jwt.oauth2.token.algorithm
◦ wt.jwt.oauth2.token.kidUrl
3. 透過 securityContext.properties.xconf 更新 securityContext.properties 檔案中的 wt.jwt.oauth2.token.jwtIdpTyp = azure。如果未為此內容提供值,則會略過權杖中特定于 Azure 的屬性,並完成標準 JWT 宣告驗證。
4. 將 securityContext.properties 檔案的位置新增至 WEB-INF/web.xml 檔案。WEB-INF/web.xml 檔案必須參照 securityContext.properties 檔案。Web.xml 檔案位於 /Codebase/WEB-INF/Web.xml。將位置新增至 Spring root Web 應用程式前後關聯位置的參數值。如果已將 securityContext.properties 檔案儲存在其預設目錄中,則下列範例有效。將路徑 WEB-INF/security/config/securityContext.xml 新增至 <param-value>config/mvc/applicationContext.xml</param-value>。前後關聯參數的結構應為:
<context-param>
<description>Location of Spring root web application context</description
<param-name>contextConfigLocation</param-name>
<param-value>config/mvc/applicationContext.xml
WEB-INF/security/config/securityContext.xml</param-value>
</context-param>
|
securityContext.xml 中也會參照 securityContext.properties 檔案的位置。如果變更 securityContext.properties 的目錄位置,請在 Web.xml 和 securityContext.xml 中更新對新位置的參照。
|
5. 在 Web.xml 檔案中的 <filter-mapping> 標籤前新增 SpringSecurityFilterChain 程式碼片段,例如:
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/oauth/*</url-pattern>
將下列程式碼片段新增到 Web.xml 檔案中的 <servlet-mapping> 標籤前。
<servlet>
<description>Bridge Servlet for Oauth Access</description>
<servlet-name>OauthAuthBridgeServlet</servlet-name>
<servlet-class>wt.servlet.AuthBridgeServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>OauthAuthBridgeServlet</servlet-name>
<url-pattern>/oauth/*</url-pattern>
</servlet-mapping>
6. 重新啟動 Windchill 和 Apache 伺服器。核對 Windchill 是否參與了 SSO 網路委派授權。