פתרון בעיות שקשורות לפריסת מדיניות של אימות בסיסי

מוצג המסמך של Apigee Edge.
עוברים אל מסמכי תיעוד של Apigee X.
מידע

UserNameRequired

הודעת שגיאה

כשפורסים את שרת ה-proxy ל-API דרך ממשק המשתמש של Edge או 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.

צילום מסך לדוגמה

סיבה

הפריסה של שרת ה-proxy ל-API תיכשל אם הרכיב <User> לא מוגדר במדיניות BasicAuthentication. הרכיב <User> הוא חובה בפעולות קידוד וגם בפעולות פענוח.

אבחון

  1. לבחון את כל כללי מדיניות האימות הבסיסי שבהם נעשה שימוש בשרת ה-proxy ל-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

הודעת שגיאה

כשפורסים את שרת ה-proxy ל-API דרך ממשק המשתמש של Edge או 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.

צילום מסך לדוגמה

סיבה

הפריסה של שרת ה-proxy ל-API תיכשל אם הרכיב <Password> לא מוגדר במדיניות BasicAuthentication. הרכיב <Password> הוא חובה בפעולות קידוד וגם בפעולות פענוח.

אבחון

  1. לבחון את כל כללי מדיניות האימות הבסיסי שבהם נעשה שימוש בשרת ה-proxy ל-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

הודעת שגיאה

כשפורסים את שרת ה-proxy ל-API דרך ממשק המשתמש של Edge או 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.

צילום מסך לדוגמה

סיבה

הפריסה של שרת ה-proxy ל-API תיכשל אם הרכיב <AssignTo> לא מוגדר במדיניות BasicAuthentication. הרכיב <AssignTo> הוא רכיב חובה בפעולות קידוד וגם בפעולות פענוח.

אבחון

  1. לבחון את כל כללי מדיניות האימות הבסיסי שבהם נעשה שימוש בשרת ה-proxy ל-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

הודעת שגיאה

כשפורסים את שרת ה-proxy ל-API דרך ממשק המשתמש של Edge או 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.

צילום מסך לדוגמה

סיבה

הפריסה של שרת ה-proxy ל-API תיכשל אם הרכיב <Source> לא מוגדר במדיניות BasicAuthentication שמשמשת לפעולת הפענוח. הרכיב <Source> הוא רכיב חובה אם ה-<Operation> מצוין כ-Decode במדיניות BasicAuthentication.

אבחון

  1. לבחון את כל כללי מדיניות האימות הבסיסי שבהם נעשה שימוש בשרת ה-proxy ל-API. אם יש מדיניות שבה הרכיב <Source> לא מוגדר והרכיב <Operation> מוגדר כ-Decode, זו הסיבה לשגיאה. הרכיב <Source> הוא רכיב חובה אם ה-<Operation> מצוין כ-Decode במדיניות 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