您正在查看 Apigee Edge 說明文件。
查看 Apigee X 說明文件。 資訊
UserNameRequired
錯誤訊息
無法透過 Edge UI 或 Edge Management API 部署 API Proxy,並顯示以下錯誤訊息:
Error Deploying Revision revision_number to env_name BasicAuthenticationPolicy: Username element must be present for operation operation.
錯誤訊息示例
Error Deploying Revision 2 to test
BasicAuthenticationPolicy: Username element must be present for Encode operation.
螢幕截圖範例
原因
如未在 BasicAuthentication 政策中定義 <User>
元素,則 API Proxy 會部署失敗。執行編碼和解碼作業都必須使用 <User>
元素。
診斷
檢查 API Proxy 中使用的所有 BasicAuthentication 政策。如有任何政策未指定
<User>
元素,就是發生錯誤的原因。執行編碼或解碼作業時,<User>
元素是 BasicAuthentication 政策中的必要元素。以下顯示的 BasicAuthentication 政策範例用於編碼作業,但尚未定義
<User>
元素:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <BasicAuthentication name="ApplyBasicAuthHeader"> <DisplayName>ApplyBasicAuthHeader</DisplayName> <Operation>Encode</Operation> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Password ref="BasicAuth.credentials.password"/> <AssignTo createNew="false">request.header.Authorization</AssignTo> </BasicAuthentication>
部署失敗並發生以下錯誤:
BasicAuthenticationPolicy: Username element must be present for Encode operation.
解析度
確保在編碼或解碼作業的 BasicAuthentication 政策中定義了 <User>
元素。
如要修正上述示例,請在政策中加入 <User>
元素,如下所示:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BasicAuthentication name="ApplyBasicAuthHeader">
<DisplayName>ApplyBasicAuthHeader</DisplayName>
<Operation>Encode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<User ref="BasicAuth.credentials.username"/>
<Password ref="BasicAuth.credentials.password"/>
<AssignTo createNew="false">request.header.Authorization</AssignTo>
</BasicAuthentication>
PasswordRequired
錯誤訊息
無法透過 Edge UI 或 Edge Management API 部署 API Proxy,並顯示以下錯誤訊息:
Error Deploying Revision revision_number to env_name BasicAuthenticationPolicy: Password element must be present for operation operation.
錯誤訊息示例
Error Deploying Revision 2 to test
BasicAuthenticationPolicy: Password element must be present for Encode operation.
螢幕截圖範例
原因
如未在 BasicAuthentication 政策中定義 <Password>
元素,則 API Proxy 會部署失敗。執行編碼和解碼作業都必須使用 <Password>
元素。
診斷
檢查 API Proxy 中使用的所有 BasicAuthentication 政策。如果有任何政策未定義
<Password>
元素,就會導致發生錯誤。「編碼」或「解碼」作業的基本驗證政策中必須要有<Password>
元素。以下顯示的 BasicAuthentication 政策範例用於編碼作業,但尚未定義
<Password>
元素:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <BasicAuthentication name="ApplyBasicAuthHeader"> <DisplayName>ApplyBasicAuthHeader</DisplayName> <Operation>Encode</Operation> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <User ref="BasicAuth.credentials.username"/> <AssignTo createNew="false">request.header.Authorization</AssignTo> </BasicAuthentication>
部署失敗並發生以下錯誤:
BasicAuthenticationPolicy: Password element must be present for Encode operation.
解析度
確保在編碼或解碼作業的 BasicAuthentication 政策中定義了 <Password>
元素。
如要修正上述示例,請在政策中加入 <Password>
元素,如下所示:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BasicAuthentication name="ApplyBasicAuthHeader">
<DisplayName>ApplyBasicAuthHeader</DisplayName>
<Operation>Encode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<User ref="BasicAuth.credentials.username"/>
<Password ref="BasicAuth.credentials.password"/>
<AssignTo createNew="false">request.header.Authorization</AssignTo>
</BasicAuthentication>
AssignToRequired
錯誤訊息
無法透過 Edge UI 或 Edge Management API 部署 API Proxy,並顯示以下錯誤訊息:
Error Deploying Revision revision_number to env_name BasicAuthenticationPolicy: AssignTo element must be present for operation operation.
錯誤訊息示例
Error Deploying Revision 2 to test
BasicAuthenticationPolicy: AssignTo element must be present for Encode operation.
螢幕截圖範例
原因
如未在 BasicAuthentication 政策中定義 <AssignTo>
元素,則 API Proxy 會部署失敗。執行編碼和解碼作業都必須使用 <AssignTo>
元素。
診斷
檢查 API Proxy 中使用的所有 BasicAuthentication 政策。如果有任何政策未定義
<AssignTo>
元素,就會導致發生錯誤。您必須在 BasicAuthentication 政策中定義<AssignTo>
元素,才能使用編碼和解碼作業。以下顯示的 BasicAuthentication 政策範例用於編碼作業,但尚未定義
<AssignTo>
元素:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <BasicAuthentication name="ApplyBasicAuthHeader"> <DisplayName>ApplyBasicAuthHeader</DisplayName> <Operation>Encode</Operation> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <User ref="BasicAuth.credentials.username"/> <Password ref="BasicAuth.credentials.password"/> </BasicAuthentication>
部署失敗並發生以下錯誤:
BasicAuthenticationPolicy: AssignTo element must be present for Encode operation.
解析度
確保在編碼或解碼作業的 BasicAuthentication 政策中定義了 <AssignTo>
元素。
如要修正上述示例,請在政策中加入 <AssignTo>
元素,如下所示:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BasicAuthentication name="ApplyBasicAuthHeader">
<DisplayName>ApplyBasicAuthHeader</DisplayName>
<Operation>Encode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<User ref="BasicAuth.credentials.username"/>
<Password ref="BasicAuth.credentials.password"/>
<AssignTo createNew="false">request.header.Authorization</AssignTo>
</BasicAuthentication>
SourceRequired
錯誤訊息
無法透過 Edge UI 或 Edge Management API 部署 API Proxy,並顯示以下錯誤訊息:
Error Deploying Revision revision_number to env_name BasicAuthenticationPolicy: Source element must be present for Decode operation.
錯誤訊息示例
Error Deploying Revision 2 to test
BasicAuthenticationPolicy: Source element must be present for Decode operation.
螢幕截圖範例
原因
如果未在用於解碼作業的 BasicAuthentication 政策中定義 <Source>
元素,則 API Proxy 部署會失敗。如果在基本驗證政策中將 <Operation>
指定為 Decode
,就必須使用 <Source>
元素。
診斷
檢查 API Proxy 中使用的所有 BasicAuthentication 政策。如果有任何政策未定義元素
<Source>
,且<Operation>
元素定義為Decode
,就會導致發生錯誤。如果在基本驗證政策中將<Operation>
指定為Decode
,就必須使用<Source>
元素。以下顯示的 BasicAuthentication 政策範例用於
Decode
作業,但尚未定義<Source>
元素:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <BasicAuthentication name="ApplyBasicAuthHeader"> <DisplayName>ApplyBasicAuthHeader</DisplayName> <Operation>Decode</Operation> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <User ref="BasicAuth.credentials.username"/> <Password ref="BasicAuth.credentials.password"/> <AssignTo createNew="false">request.header.Authorization</AssignTo> </BasicAuthentication>
部署失敗並發生以下錯誤:
BasicAuthenticationPolicy: Source element must be present for Decode operation.
解析度
確保將 <Source>
元素用於 Decode
作業時,您已在 BasicAuthentication 政策中定義該元素。
如要修正上述示例,請在政策中加入 <Source>
元素,如下所示:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BasicAuthentication name="ApplyBasicAuthHeader">
<DisplayName>ApplyBasicAuthHeader</DisplayName>
<Operation>Decode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<User ref="BasicAuth.credentials.username"/>
<Password ref="BasicAuth.credentials.password"/>
<AssignTo createNew="false">request.header.Authorization</AssignTo>
<Source>request.header.Authorization</Source>
</BasicAuthentication>