Static Tokens & Physical Authentication
Static tokens make auth URLs reusable: pass a static_token so the same URL can be used many times (e.g. printed on a table, written to NFC).
API
newKeyHandshakeUrl with a static_token — the returned URL does not expire after one use. Use it for location-specific auth (tables, doors, kiosks). Your callback receives the same token context so you can associate the handshake with a place.
HTTP
curl -s -X POST $BASE_URL/key-handshake \
-H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"static_token": "table-14-restaurant-a"}'
# → { "stream_id": "abc123", "url": "nostr+walletconnect://..." }
# The URL can be reused — print it as QR, write to NFC, etc.
# Poll events/abc123 to receive each user's public key as they scan.
JavaScript
const staticToken = 'table-14-restaurant-a';
const authUrl = await client.newKeyHandshakeUrl(
(mainKey, preferredRelays) => {
// mainKey + staticToken identify who and where
handleLocationAuth(staticToken, mainKey);
},
staticToken
);
// Share authUrl (QR, NFC, link); it can be reused
Java
import cc.getportal.command.request.KeyHandshakeUrlRequest;
import cc.getportal.command.response.KeyHandshakeUrlResponse;
import cc.getportal.command.notification.KeyHandshakeUrlNotification;
sdk.sendCommand(
new KeyHandshakeUrlRequest("my-static-token", null, (n) ->
System.out.println("mainKey: " + n.main_key())),
(res, err) -> {
if (err != null) { System.err.println(err); return; }
System.out.println("URL: " + res.url());
}
);
You are responsible for generating QR codes or writing to NFC; the API only provides the URL.
Next: Single Payments · Authentication