Sau khi bật SAML hoặc LDAP trên Edge, bạn có thể tắt tính năng Xác thực cơ bản. Tuy nhiên, trước khi tắt tính năng Xác thực cơ bản:
- Đảm bảo bạn đã thêm tất cả người dùng Edge, bao gồm cả quản trị viên hệ thống, vào IDP của bạn.
- Đảm bảo bạn đã kiểm thử kỹ quy trình xác thực IDP trên Giao diện người dùng Edge mới và API quản lý Edge.
Xem hồ sơ bảo mật hiện tại
Bạn có thể xem hồ sơ bảo mật của Edge để xác định cấu hình hiện tại nhằm biết liệu phương thức xác thực cơ bản và nhà cung cấp danh tính (IDP) bên ngoài có đang được bật hay không. Sử dụng lệnh gọi API quản lý Edge sau đây trên Máy chủ quản lý Edge để xem hồ sơ bảo mật hiện tại mà Edge sử dụng:
curl -H "accept:application/xml" http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWord
Nếu bạn chưa định cấu hình một IDP bên ngoài, thì phản hồi sẽ như bên dưới, tức là xác thực Cơ bản đã được bật:
<SecurityProfile enabled="true" name="securityprofile">
<UserAccessControl enabled="true">
</UserAccessControl>
</SecurityProfile>Nếu bạn đã bật một IDP bên ngoài, thì phần tử <ssoserver> sẽ xuất hiện trong phản hồi:
<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>Lưu ý rằng phiên bản đã bật IDP bên ngoài cũng cho thấy <BasicAuthEnabled>true</BasicAuthEnabled>, tức là phương thức xác thực cơ bản vẫn được bật.
Tắt phương thức xác thực cơ bản
Sử dụng lệnh gọi API quản lý Edge sau đây trên Máy chủ quản lý Edge để tắt tính năng Xác thực cơ bản.
Để tắt tính năng xác thực cơ bản, bạn truyền đối tượng XML được trả về trong phần trước dưới dạng tải trọng. Điểm khác biệt duy nhất là bạn đặt <BasicAuthEnabled> thành false, như trong ví dụ sau:
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>'Sau khi bạn tắt tính năng Xác thực cơ bản, mọi lệnh gọi API quản lý Edge truyền thông tin xác thực cơ bản sẽ trả về lỗi sau:
<Error>
<Code>security.SecurityProfileBasicAuthDisabled</Code>
<Message>Basic Authentication scheme not allowed</Message>
<Contexts/>
</Error>Bật lại phương thức xác thực cơ bản
Nếu vì lý do nào đó mà bạn phải bật lại tính năng Xác thực cơ bản, bạn phải thực hiện các bước sau:
- Đăng nhập vào bất kỳ nút Edge ZooKeeper nào.
- Chạy tập lệnh bash sau để tắt mọi biện pháp bảo mật:
#! /bin/bash /opt/apigee/apigee-zookeeper/bin/zkCli.sh -server localhost:2181 <<EOF set /system/securityprofile <SecurityProfile></SecurityProfile> quit EOF
Bạn sẽ thấy kết quả có dạng:
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...
- Bật lại phương thức xác thực cơ bản và phương thức xác thực IDP bên ngoài:
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>'
Giờ đây, bạn có thể sử dụng lại phương thức Xác thực cơ bản. Để chuyển giao diện người dùng Edge mới từ
SSO trở lại chế độ Xác thực cơ bản, hãy đặt AUTH_MODE=basic và
MANAGEMENT_UI_SSO_ENABLED=n trong tệp cấu hình Giao diện người dùng Edge mới, sau đó chạy
/opt/apigee/apigee-service/bin/apigee-service edge-management-ui configure-sso -f configFile
theo sau là
/opt/apigee/apigee-service/bin/apigee-service edge-management-ui restart
(hoặc chạy /opt/apigee/apigee-setup/bin/setup.sh -p ue -f configFile).