Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. Socket.io Authentifizierung

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Socket.io Authentifizierung

    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Benda last edited by

      Hi Leute,

      kann mir jemand auf die Sprünge helfen wie ich die Authentifizierung mit dem Socket.io Adapter realisiere?
      Ohne Auth im Admin bekomme ich die Daten über https ausgelesen, sobald ich allerdings auth in den Adapter settings angebe, funzt es nicht mehr.

      Ich finde leider auch keine doku wo, bzw wie ich die credentials im client angebe:

      {
              name: 'mobile.0', // optional - default 'vis.0'
              connLink: 'https://192.168.1.35:8084', // optional URL of the socket.io adapter
              socketSession: '', // optional - used by authentication
            },
      

      habe schon einiges für socketSession probiert,
      das wird im script ja als query mit key=... beim verbinden eingefügt?!

      UncleSam 1 Reply Last reply Reply Quote 0
      • UncleSam
        UncleSam Developer @Benda last edited by

        @benda authenticate() geht nicht?
        Siehe hier: https://github.com/ioBroker/ioBroker.socketio/blob/919a467121e673590377a4fd1023f99ee38656b5/example/conn.js#L1294

        B 1 Reply Last reply Reply Quote 0
        • B
          Benda @UncleSam last edited by

          @unclesam Leider nein, habe ich auch schon probiert,
          Dann liefert er mir nur No connection!

          Weder vor oder nach serverConn.init()

          UncleSam 1 Reply Last reply Reply Quote 0
          • UncleSam
            UncleSam Developer @Benda last edited by

            @benda Die Doku ist grauenvoll und der Code teilweise nicht komplett! authenticate() macht tatsächlich nichts.

            Aber ich habe diese Zeile gefunden: https://github.com/ioBroker/ioBroker.socketio/blob/919a467121e673590377a4fd1023f99ee38656b5/lib/socket.js#L1750

            Hast du mal versucht bei der URL einfach noch ?user=xxx&pass=yyy einzugeben?

            B 1 Reply Last reply Reply Quote 0
            • B
              Benda @UncleSam last edited by Benda

              Oje, ich habs hingekriegt, schau mal:
              https://github.com/ioBroker/ioBroker.socketio/blob/919a467121e673590377a4fd1023f99ee38656b5/example/conn.js#L240
              und hier:
              https://github.com/ioBroker/ioBroker.socketio/blob/919a467121e673590377a4fd1023f99ee38656b5/example/conn.js#L260

              connOptions hat eine property socketOptions, die wird übernommen als
              query key=${socketOptions}

              d.h. meine config sieht so aus:

              connLink: 'https://192.168.1.35:8084', // optional URL of the socket.io adapter
                      socketSession: 'abc&user=admin&pass=*****', // optional - used by authentication
              

              Das abc ist der Wert für die key property, wofür die steht, ka, aber mit user und pass funzt es 🙂

              1 Reply Last reply Reply Quote 1
              • First post
                Last post

              Support us

              ioBroker
              Community Adapters
              Donate

              420
              Online

              31.9k
              Users

              80.2k
              Topics

              1.3m
              Posts

              2
              5
              378
              Loading More Posts
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes
              Reply
              • Reply as topic
              Log in to reply
              Community
              Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
              The ioBroker Community 2014-2023
              logo