ปิดใช้การตรวจสอบสิทธิ์ขั้นพื้นฐานใน Edge

หลังจากเปิดใช้ SAML หรือ LDAP ใน Edge แล้ว คุณจะปิดใช้การตรวจสอบสิทธิ์ขั้นพื้นฐานได้ แต่ก่อนที่คุณจะปิดใช้การตรวจสอบสิทธิ์พื้นฐาน จะมีการดำเนินการต่อไปนี้

  • ตรวจสอบว่าคุณได้เพิ่มผู้ใช้ Edge ทั้งหมด รวมถึงผู้ดูแลระบบลงใน IDP แล้ว
  • ตรวจสอบว่าคุณได้ทดสอบการตรวจสอบสิทธิ์ IDP อย่างละเอียดใน Edge UI และ API การจัดการ Edge แล้ว
  • หากคุณใช้พอร์ทัล Apigee Developer Services (หรือเรียกง่ายๆ ว่าพอร์ทัล) ให้กำหนดค่าและทดสอบ IdP ภายนอกในพอร์ทัลเพื่อให้แน่ใจว่าพอร์ทัลเชื่อมต่อกับ Edge ได้ โปรดดูการกำหนดค่าพอร์ทัลสำหรับ IdP ภายนอก

ดูโปรไฟล์ความปลอดภัยปัจจุบัน

คุณสามารถดูโปรไฟล์ความปลอดภัยของ Edge เพื่อดูการกำหนดค่าปัจจุบันและตรวจสอบว่าการตรวจสอบสิทธิ์ขั้นพื้นฐานและ IdP ภายนอกเปิดใช้อยู่หรือไม่ ใช้การเรียก Edge Management API ต่อไปนี้ใน Edge Management Server เพื่อดูโปรไฟล์ความปลอดภัยปัจจุบันที่ Edge ใช้อยู่

curl -H "accept:application/xml" http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWord

หากคุณยังไม่ได้กำหนดค่า IdP ภายนอก คำตอบจะปรากฏด้านล่าง ซึ่งหมายความว่ามีการเปิดใช้การตรวจสอบสิทธิ์พื้นฐาน

<SecurityProfile enabled="true" name="securityprofile">
    <UserAccessControl enabled="true">
    </UserAccessControl>
</SecurityProfile>

หากเปิดใช้ IdP ภายนอกแล้ว องค์ประกอบ <ssoserver> ควรปรากฏในการตอบกลับ

<SecurityProfile enabled="true" name="securityprofile">
    <UserAccessControl enabled="true">
        <SSOServer>
            <BasicAuthEnabled>true</BasicAuthEnabled>
            <PublicKeyEndPoint>/token_key</PublicKeyEndPoint>
            <ServerUrl>http://35.197.37.220:9099</ServerUrl>
        </SSOServer>
    </UserAccessControl>
</SecurityProfile>

โปรดทราบว่าเวอร์ชันที่มีการเปิดใช้ IdP ภายนอกจะแสดง <BasicAuthEnabled>true</BasicAuthEnabled> ซึ่งหมายความว่ายังคงเปิดใช้การตรวจสอบสิทธิ์ขั้นพื้นฐานอยู่

ปิดใช้การตรวจสอบสิทธิ์พื้นฐาน

ใช้การเรียก Edge Management API ต่อไปนี้ใน Edge Management Server เพื่อปิดใช้การตรวจสอบสิทธิ์พื้นฐาน

หากต้องการปิดใช้การตรวจสอบสิทธิ์พื้นฐาน ให้ส่งออบเจ็กต์ XML ที่แสดงผลในส่วนก่อนหน้าเป็นเพย์โหลด ความแตกต่างเพียงอย่างเดียวคือคุณตั้งค่า <BasicAuthEnabled> เป็น false ตามตัวอย่างต่อไปนี้

curl -H "Content-Type: application/xml"
http://localhost:8080/v1/securityprofile  -u sysAdminEmail:pWord -d
 '<SecurityProfile enabled="true" name="securityprofile">
  <UserAccessControl enabled="true">
    <SSOServer>
      <BasicAuthEnabled>false</BasicAuthEnabled>
      <PublicKeyEndPoint>/token_key</PublicKeyEndPoint>
      <ServerUrl>http://35.197.37.220:9099</ServerUrl>
  </SSOServer>
 </UserAccessControl>
</SecurityProfile>'

หลังจากที่ปิดใช้การตรวจสอบสิทธิ์พื้นฐาน การเรียก Edge Management API ที่ส่งข้อมูลเข้าสู่ระบบการตรวจสอบสิทธิ์พื้นฐานจะแสดงข้อผิดพลาดต่อไปนี้

<Error>
    <Code>security.SecurityProfileBasicAuthDisabled</Code>
    <Message>Basic Authentication scheme not allowed</Message>
    <Contexts/>
</Error>

เปิดใช้การตรวจสอบสิทธิ์พื้นฐานอีกครั้ง

หากคุณต้องเปิดใช้การตรวจสอบสิทธิ์พื้นฐานอีกครั้งไม่ว่าด้วยเหตุผลใดก็ตาม คุณต้องทำตามขั้นตอนต่อไปนี้

  1. เข้าสู่ระบบโหนด Edge ZooKeeper
  2. เรียกใช้สคริปต์ Bash ต่อไปนี้เพื่อปิดความปลอดภัยทั้งหมด
    #! /bin/bash
    /opt/apigee/apigee-zookeeper/bin/zkCli.sh -server localhost:2181 <<EOF
    set /system/securityprofile <SecurityProfile></SecurityProfile>
    quit
    EOF

    คุณจะเห็นเอาต์พุตในรูปแบบต่อไปนี้

    Connecting to localhost:2181
    Welcome to ZooKeeper!
    JLine support is enabled
    WATCHER::
    WatchedEvent state:SyncConnected
    type:None path:null
    [zk: localhost:2181(CONNECTED) 0]
    set /system/securityprofile <SecurityProfile></SecurityProfile>
    cZxid = 0x89
    ...
    [zk: localhost:2181(CONNECTED) 1] quit
    Quitting...
  3. เปิดใช้การตรวจสอบสิทธิ์ขั้นพื้นฐานและการตรวจสอบสิทธิ์ IdP ภายนอกอีกครั้ง:
    curl -H "Content-Type: application/xml" http://localhost:8080/v1/securityprofile
      -u sysAdminEmail:pWord -d '<SecurityProfile enabled="true" name="securityprofile">
      <UserAccessControl enabled="true">
      <SSOServer>
      <BasicAuthEnabled>true</BasicAuthEnabled>
      <PublicKeyEndPoint>/token_key</PublicKeyEndPoint>
      <ServerUrl>http://35.197.37.220:9099</ServerUrl>
      </SSOServer>
      </UserAccessControl>
      </SecurityProfile>'

คุณสามารถใช้การตรวจสอบสิทธิ์พื้นฐานได้อีกครั้งแล้ว โปรดทราบว่าการตรวจสอบสิทธิ์ขั้นพื้นฐานจะไม่ทำงานเมื่อมีการเปิดใช้ประสบการณ์ Edge ใหม่