Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Geschrieben

Moin,

 

ich hab' mich heute mal an der Authentifizierung am Stapel versucht.

 

Perl ist die Sprache meiner Wahl.

 

Dabei stellte ich fest, dass die Authentifizierung nicht klappte. Im brickv geht's allerdings.

 

Kurzes rumstöbern in Tinkerforge/IPConnection.pm, Funktion 'authenticate', brachte zu Tage dass das Formatieren des Server-Nonces zur weiteren Verarbeitung Murks ergibt.

 

Jetzt sieht der Teil der Funktion, auf den es mir ankommt, wie folgt aus:

my @serverNonceArray = $self->_brickd_get_authentication_nonce();
#print "ServerNonceArray:\n" . Dumper(@serverNonceArray) . "\n\n";
# Following statement is superfluous, as $serverNonce is never used
#my $serverNonce = \@serverNonceArray;
        # below, we need to dereference...
my $serverNonceBytes = pack('C4', @{$serverNonceArray[0]});
#print "ServerNonceBytes:\n" . Dumper($serverNonceBytes) . "\n\n";
my $clientNonceNumber = $self->{next_authentication_nonce}++;

und funktioniert.

 

Kompletten Patch gerne auf Anfrage, wird aber vermutlich nicht nötig sein :-)

 

Möglicherweise ist die korrekte Kur aber eine Ebene tiefer im API sinnvoller, aber *darein* hab' ich mich nicht begeben...

 

Arno

  • 2 weeks later...
Geschrieben

Stimmt, da ist ein Bug. Das hat original mal funktioniert, und ja die $serverNonce Variable war schon immer überflüssig. Allerdings wurde danach die Unpack Logik überarbeitet, so dass dann _brickd_get_authentication_nonce() nicht mehr ein Array sondern eine Referenz auf ein Array zurückgegeben hat. Die authenticate Funktion wurde aber daran nicht angepasst.

 

Deine Lösung dazu funktioniert, hier ist meine:

 

https://github.com/Tinkerforge/generators/commit/ce21670b63cc07417e0d3540a57f9f0d53a32fd7

 

Danke für den Hinweis!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.