Edge で Basic 認証を無効にする

Edge で SAML または LDAP を有効にしたら、Basic 認証を無効にできます。ただし、 Basic 認証を無効にする前に以下の点を確認してください。

  • システム管理者を含むすべての Edge ユーザーが IDP
  • Edge UI と Edge で IDP 認証を十分にテストしていることを確認します。 管理 API を使用できます。
  • Apigee Developer Services ポータル(略して「ポータル」)を使用している場合は、ポータルで外部 IDP を構成してテストします。 ポータルが Edge に接続できることを確認します。詳しくは、 外部 IDP 用にポータルを構成する

現在のセキュリティ プロファイルを表示する

Edge のセキュリティ プロファイルを表示して現在の構成を確認し、 現在、基本認証と外部 IDP が有効になっています。次の Edge 管理を使用してください。 Edge Management Server で API 呼び出しを実行し、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 が有効になっているバージョンには、 &lt;BasicAuthEnabled&gt;true&lt;/BasicAuthEnabled&gt;: 認証は引き続き有効です。

基本認証を無効にする

Basic を無効にするには、Edge 管理サーバーで次の Edge 管理 API 呼び出しを使用します あります。

Basic 認証を無効にするには、前のセクションで返された 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>'

Basic 認証を無効にした後は、Basic 認証に合格する Edge Management API 呼び出し 認証情報から次のエラーが返されます。

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

基本認証を再度有効にする

なんらかの理由で Basic 認証を再度有効にする必要がある場合は、次のことを行う必要があります。 手順:

  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>'

これで、基本認証を再び使用できるようになりました。基本認証は機能しません。 。