Kubernetes デプロイメントを使用して Node.js アプリのシングル サインオンを使用する方法は?

Kubernetes デプロイメントを使用して Node.js アプリのシングル サインオンを使用する方法は?

Express と Microsoft 認証を使用して、サンプルの node.js アプリでシングル サインオンを設定してみました。

これが手順ですソースコードリンク

ローカルで実行すると、動作します。Kubernetes に保持し、ロード バランサー サービスの IP を使用して直接アクセスすると、動作します。ただし、Azure Ubuntu マシンに k3s VM を展開し、Azure App Gateway を同じネットワークに保持し、このロード バランサー IP にルーティングするようにトラフィックを構成すると、サインイン ページに移動します。 ウェブページが読み込まれました

しかし、「サインイン」ボタンをクリックすると502 Bad Gatewayエラーが発生します。 502 エラー

更新をクリックすると、ログにエラーが記録されます。これは、エラーが発生したときのポッド ログです。

      onocspresponse: [Function: onocspresponse],
      onnewsession: [Function: onnewsessionclient],
      onerror: [Function: onerror],
      [Symbol(owner_symbol)]: [Circular *1]
    },
    _requestCert: true,
    _rejectUnauthorized: true,
    parser: null,
    _httpMessage: [Circular *2],
    [Symbol(res)]: TLSWrap {
      _parent: TCP {
        reading: [Getter/Setter],
        onconnection: null,
        [Symbol(owner_symbol)]: [Circular *1]
      },
      _parentWrap: undefined,
      _secureContext: SecureContext { context: SecureContext {} },
      reading: true,
      onkeylog: [Function: onkeylog],
      onhandshakestart: {},
      onhandshakedone: [Function (anonymous)],
      onocspresponse: [Function: onocspresponse],
      onnewsession: [Function: onnewsessionclient],
      onerror: [Function: onerror],
      [Symbol(owner_symbol)]: [Circular *1]
    },
    [Symbol(verified)]: true,
    [Symbol(pendingSession)]: null,
    [Symbol(async_id_symbol)]: 76,
    [Symbol(kHandle)]: TLSWrap {
      _parent: TCP {
        reading: [Getter/Setter],
        onconnection: null,
        [Symbol(owner_symbol)]: [Circular *1]
      },
      _parentWrap: undefined,
      _secureContext: SecureContext { context: SecureContext {} },
      reading: true,
      onkeylog: [Function: onkeylog],
      onhandshakestart: {},
      onhandshakedone: [Function (anonymous)],
      onocspresponse: [Function: onocspresponse],
      onnewsession: [Function: onnewsessionclient],
      onerror: [Function: onerror],
      [Symbol(owner_symbol)]: [Circular *1]
    },
    [Symbol(lastWriteQueueSize)]: 0,
    [Symbol(timeout)]: null,
    [Symbol(kBuffer)]: null,
    [Symbol(kBufferCb)]: null,
    [Symbol(kBufferGen)]: null,
    [Symbol(kCapture)]: false,
    [Symbol(kSetNoDelay)]: false,
    [Symbol(kSetKeepAlive)]: true,
    [Symbol(kSetKeepAliveInitialDelay)]: 60,
    [Symbol(kBytesRead)]: 0,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(connect-options)]: {
      rejectUnauthorized: true,
      ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
      checkServerIdentity: [Function: checkServerIdentity],
      minDHSize: 1024,
      maxRedirects: 21,
      maxBodyLength: Infinity,
      protocol: 'https:',
      path: null,
      method: 'GET',
      headers: [Object: null prototype] { To bottom Logs from 9/12/2023, 11:19:18 AM

関連情報