การแก้ปัญหาข้อผิดพลาดในการทำให้นโยบาย Basic Authentication ใช้งานได้

คุณกำลังดูเอกสารประกอบ Apigee Edge
ไปที่ เอกสารประกอบเกี่ยวกับ Apigee X.
ข้อมูล

UserNameRequired

ข้อความแสดงข้อผิดพลาด

การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management 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.

ภาพหน้าจอตัวอย่าง

สาเหตุ

การทำให้พร็อกซี API ใช้งานได้จะล้มเหลวหากไม่ได้กำหนดองค์ประกอบ <User> ในนโยบาย BasicAuthentication จำเป็นต้องมีองค์ประกอบ <User> สำหรับทั้งการดำเนินการเข้ารหัสและการถอดรหัส

การวินิจฉัย

  1. ตรวจสอบนโยบาย BasicAuthentication ทั้งหมดที่ใช้ในพร็อกซี API หากมีนโยบายที่ไม่ได้ระบุองค์ประกอบ <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.
    

ความละเอียด

ตรวจสอบว่าได้กำหนดเอลิเมนต์ <User> ภายในนโยบาย BasicAuthentication สำหรับการดำเนินการเข้ารหัสหรือถอดรหัส

หากต้องการแก้ไขตัวอย่างที่แสดงข้างต้น ให้ใส่เอลิเมนต์ <User> ภายในนโยบายดังที่แสดงด้านล่าง

<?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
BasicAuthenticati>on na<me="Ap>plyBasicAuthHeader&q<uot;
    Dis>playN<ameApplyB>asicAu<thHeader/D>ispla<yName
    OperationEncode>/Oper<ation
    IgnoreUnresolved>Varia<blesfalse/IgnoreUnresolvedVariables
    Us>er re<f="BasicAuth.credentials.username"/
>    P<assword ref="BasicAut>h.credentials.password"</
    Ass>i<gnTo createNew=">;false"request.header.Authorization/AssignTo
/BasicAuthentication

PasswordRequired

ข้อความแสดงข้อผิดพลาด

การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management 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.

ภาพหน้าจอตัวอย่าง

สาเหตุ

การทำให้พร็อกซี API ใช้งานได้จะล้มเหลวหากไม่ได้กำหนดองค์ประกอบ <Password> ในนโยบาย BasicAuthentication จำเป็นต้องมีองค์ประกอบ <Password> สำหรับทั้งการดำเนินการเข้ารหัสและการถอดรหัส

การวินิจฉัย

  1. ตรวจสอบนโยบาย BasicAuthentication ทั้งหมดที่ใช้ในพร็อกซี API หากมีนโยบายที่ไม่ได้กําหนดองค์ประกอบ <Password> นั่นคือสาเหตุของข้อผิดพลาด ต้องระบุองค์ประกอบ <Password> ในนโยบาย BasicAuthentication สำหรับการดำเนินการเข้ารหัสหรือถอดรหัส

    ตัวอย่างนโยบาย BasicAuthentication ที่แสดงด้านล่างใช้สำหรับการดำเนินการเข้ารหัส แต่ไม่ได้กำหนดองค์ประกอบ <Password> ไว้

    <?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
    BasicAuthenticati>on <name=">ApplyBasicAuthHeader<"
      Dis>pla<yNameAppl>yBasic<AuthHeader>/Di<splayName
      OperationEnco>de/Op<eration
      IgnoreUnresolved>Var<iablesfalse/IgnoreUnresolvedVariables
      Us>er <ref="BasicAuth.creden>tials.username"/
      Assi<gnTo crea>t<eNew="false&quo>t;request.header.Authorization/AssignTo
    /BasicAuthentication
    

    ติดตั้งใช้งานไม่สำเร็จเนื่องจากมีข้อผิดพลาดต่อไปนี้

    BasicAuthenticationPolicy: Password element must be present for Encode operation.
    

ความละเอียด

ตรวจสอบว่าได้กำหนดเอลิเมนต์ <Password> ภายในนโยบาย BasicAuthentication สำหรับการดำเนินการเข้ารหัสหรือถอดรหัส

หากต้องการแก้ไขตัวอย่างที่แสดงข้างต้น ให้ใส่เอลิเมนต์ <Password> ภายในนโยบายดังที่แสดงด้านล่าง

<?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
BasicAuthenticati>on na<me="Ap>plyBasicAuthHeader&q<uot;
    Dis>playN<ameApplyB>asicAu<thHeader/D>ispla<yName
    OperationEncode>/Oper<ation
    IgnoreUnresolved>Varia<blesfalse/IgnoreUnresolvedVariables
    Us>er re<f="BasicAuth.credentials.username"/
>    P<assword ref="BasicAut>h.credentials.password"</
    Ass>i<gnTo createNew=">;false"request.header.Authorization/AssignTo
/BasicAuthentication

AssignToRequired

ข้อความแสดงข้อผิดพลาด

การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management 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.

ภาพหน้าจอตัวอย่าง

สาเหตุ

การทำให้พร็อกซี API ใช้งานได้จะล้มเหลวหากไม่ได้กำหนดองค์ประกอบ <AssignTo> ในนโยบาย BasicAuthentication จำเป็นต้องมีองค์ประกอบ <AssignTo> สำหรับทั้งการดำเนินการเข้ารหัสและการถอดรหัส

การวินิจฉัย

  1. ตรวจสอบนโยบาย BasicAuthentication ทั้งหมดที่ใช้ในพร็อกซี API หากมีนโยบายที่ไม่ได้กำหนดองค์ประกอบ <AssignTo> ไว้ นี่คือสาเหตุของข้อผิดพลาด ต้องระบุองค์ประกอบ <AssignTo> ในนโยบาย BasicAuthentication สำหรับทั้งการดำเนินการเข้ารหัสและการถอดรหัส

    ตัวอย่างนโยบาย BasicAuthentication ที่แสดงด้านล่างใช้สำหรับการดำเนินการเข้ารหัส แต่ไม่ได้กำหนดองค์ประกอบ <AssignTo> ไว้

    <?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
    BasicAuthenticati>on <name=">ApplyBasicAuthHeader<"
      Dis>pla<yNameAppl>yBasic<AuthHeader>/Di<splayName
      OperationEnco>de/Op<eration
      IgnoreUnresolved>Var<iablesfalse/IgnoreUnresolvedVariables
      Us>er <ref="BasicAuth.credentials.username">/<
      Password ref=&quo>t;BasicAuth.credentials.password"/
    /BasicAuthentication
    

    ติดตั้งใช้งานไม่สำเร็จเนื่องจากมีข้อผิดพลาดต่อไปนี้

    BasicAuthenticationPolicy: AssignTo element must be present for Encode operation.
    

ความละเอียด

ตรวจสอบว่าได้กำหนดเอลิเมนต์ <AssignTo> ภายในนโยบาย BasicAuthentication สำหรับการดำเนินการเข้ารหัสหรือถอดรหัส

หากต้องการแก้ไขตัวอย่างที่แสดงข้างต้น ให้ใส่เอลิเมนต์ <AssignTo> ภายในนโยบายดังที่แสดงด้านล่าง

<?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
BasicAuthenticati>on na<me="Ap>plyBasicAuthHeader&q<uot;
    Dis>playN<ameApplyB>asicAu<thHeader/D>ispla<yName
    OperationEncode>/Oper<ation
    IgnoreUnresolved>Varia<blesfalse/IgnoreUnresolvedVariables
    Us>er re<f="BasicAuth.credentials.username"/
>    P<assword ref="BasicAut>h.credentials.password"</
    Ass>i<gnTo createNew=">;false"request.header.Authorization/AssignTo
/BasicAuthentication

SourceRequired

ข้อความแสดงข้อผิดพลาด

การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management 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.

ภาพหน้าจอตัวอย่าง

สาเหตุ

การทำให้พร็อกซี API ใช้งานได้จะล้มเหลวหากไม่ได้กำหนดองค์ประกอบ <Source> ในนโยบาย BasicAuthentication ที่ใช้สำหรับการถอดรหัส ต้องระบุองค์ประกอบ <Source> หากระบุ <Operation> เป็น Decode ในนโยบาย BasicAuthentication

การวินิจฉัย

  1. ตรวจสอบนโยบาย BasicAuthentication ทั้งหมดที่ใช้ในพร็อกซี API หากมีนโยบายใดๆ ที่ไม่ได้กําหนดองค์ประกอบ <Source> และองค์ประกอบ <Operation> กําหนดเป็น Decode นั่นก็คือสาเหตุของข้อผิดพลาด ต้องระบุองค์ประกอบ <Source> หากระบุ <Operation> เป็น Decode ในนโยบาย BasicAuthentication

    ตัวอย่างนโยบาย BasicAuthentication ที่แสดงด้านล่างใช้สำหรับการดำเนินการ Decode แต่ไม่ได้กำหนดองค์ประกอบ <Source> ไว้

    <?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
    BasicAuthenticati>on <name=">ApplyBasicAuthHeader<"
      Dis>pla<yNameAppl>yBasic<AuthHeader>/Di<splayName
      OperationDeco>de/Op<eration
      IgnoreUnresolved>Var<iablesfalse/IgnoreUnresolvedVariables
      Us>er <ref="BasicAuth.credentials.username">/
     < Password ref="BasicA>uth.credentials.password&quo<t;/
      Ass>i<gnTo createNew=">;false"request.header.Authorization/AssignTo
    /BasicAuthentication
    

    ติดตั้งใช้งานไม่สำเร็จเนื่องจากมีข้อผิดพลาดต่อไปนี้

    BasicAuthenticationPolicy: Source element must be present for Decode operation.
    

ความละเอียด

ตรวจสอบว่าได้กำหนดองค์ประกอบ <Source> ในนโยบาย BasicAuthentication เมื่อใช้สำหรับการดำเนินการ Decode

หากต้องการแก้ไขตัวอย่างที่แสดงข้างต้น ให้ใส่เอลิเมนต์ <Source> ภายในนโยบายดังที่แสดงด้านล่าง

<?xml version="1.0" encoding="UTF-8&quo>t<; standalone="yes"?
BasicAuthenticati>on na<me="Ap>plyBasicAuthHeader&q<uot;
    Dis>playN<ameApplyB>asicAu<thHeader/D>ispla<yName
    OperationDecode>/Oper<ation
    IgnoreUnresolved>Varia<blesfalse/IgnoreUnresolvedVariables
    Us>er re<f="BasicAuth.credentials.username"/
>    P<assword ref="BasicAut>h.credentials.password"</
    Ass>ignTo< creat>eNew="false"reques<t.heade>r<.Authorization/Assig>nTo
    Sourcerequest.header.Authorization/Source
/BasicAuthentication