Wie verwende ich die einmalige Anmeldung einer Node.js-App mit Kubernetes-Bereitstellung?

Wie verwende ich die einmalige Anmeldung einer Node.js-App mit Kubernetes-Bereitstellung?

Ich habe versucht, Single Sign-On für eine Beispiel-Node.js-App mit Express- und Microsoft-Authentifizierung einzurichten.

Dies sind die Schritte undQuellcode-Link

Wenn ich es lokal ausführe, funktioniert es. Wenn ich es in Kubernetes behalte und direkt über die IP des Load Balancer-Dienstes zugreife, funktioniert es. Aber wenn ich eine K3s-VM auf einer Azure Ubuntu-Maschine bereitstelle und das Azure App Gateway im selben Netzwerk behalte und den Datenverkehr so ​​konfiguriere, dass er an diese IP des Load Balancer weitergeleitet wird, wird er zur Anmeldeseite weitergeleitet. Webseite geladen

Aber wenn ich auf die Schaltfläche „Anmelden“ klicke, wird ein 502 Bad GatewayFehler angezeigt. Fehler 502

Wenn ich auf Aktualisieren klicke, erscheint ein Fehler im Protokoll. Dies ist das Pod-Protokoll, als dieser Fehler auftrat.

      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

verwandte Informationen