BasicAuthentication ポリシーのデプロイエラーのトラブルシューティング

現在、Apigee Edge のドキュメントを表示しています。
Apigee X のドキュメントをご確認ください
情報

UserNameRequired

エラー メッセージ

Edge UI または Edge 管理 API を使用した API プロキシのデプロイに失敗し、次のエラー メッセージが表示されます。

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 プロキシのデプロイは失敗します。<User> 要素は Encode オペレーションと Decode オペレーションの両方に必須です。

診断

  1. API プロキシで使用されているすべての BasicAuthentication ポリシーを確認します。<User> 要素が指定されていないポリシーがある場合、それがエラーの原因です。BasicAuthentication ポリシーでは、Encode オペレーションまたは Decode オペレーションに <User> 要素は必須です。

    以下に示す BasicAuthentication ポリシーのサンプルは Encode オペレーションに使用されるものですが、<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 ポリシー内で、Encode オペレーションまたは Decode オペレーションに <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 管理 API を使用した API プロキシのデプロイに失敗し、次のエラー メッセージが表示されます。

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 プロキシのデプロイは失敗します。Encode オペレーションと Decode オペレーションの両方に <Password> 要素は必須です。

診断

  1. API プロキシで使用されているすべての BasicAuthentication ポリシーを確認します。<Password> 要素が定義されていないポリシーがある場合、それがエラーの原因です。BasicAuthentication ポリシーでは、Encode オペレーションまたは Decode オペレーションに <Password> 要素は必須です。

    以下に示す BasicAuthentication ポリシーのサンプルは Encode オペレーションに使用されるものですが、<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 ポリシー内で、Encode オペレーションまたは Decode オペレーションに <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 管理 API を使用した API プロキシのデプロイに失敗し、次のエラー メッセージが表示されます。

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 プロキシのデプロイは失敗します。Encode オペレーションと Decode オペレーションの両方に <AssignTo> 要素は必須です。

診断

  1. API プロキシで使用されているすべての BasicAuthentication ポリシーを確認します。<AssignTo> 要素が定義されていないポリシーがある場合、それがエラーの原因です。<AssignTo> 要素は、BasicAuthentication ポリシーの Encode オペレーションと Decode オペレーションの両方で定義する必要があります。

    以下に示す BasicAuthentication ポリシーのサンプルは Encode オペレーションに使用されるものですが、<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 ポリシー内で、Encode オペレーションまたは Decode オペレーションに <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 管理 API を使用した API プロキシのデプロイに失敗し、次のエラー メッセージが表示されます。

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.

スクリーン ショットの例

原因

Decode オペレーションに使用される <Source> 要素が BasicAuthentication ポリシーで定義されていない場合、API プロキシのデプロイは失敗します。BasicAuthentication ポリシーで <Operation>Decode として指定されている場合、<Source> 要素は必須です。

診断

  1. API プロキシで使用されているすべての BasicAuthentication ポリシーを確認します。<Source> 要素が定義されていないのに <Operation> 要素が Decode として定義されているポリシーがある場合、それがエラーの原因です。BasicAuthentication ポリシーで <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.
    

解像度

Decode オペレーションで使用する場合、BasicAuthentication ポリシーで <Source> 要素が定義されていることを確認します。

上記の例を修正するには、次のようにポリシー内に <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>