🚀
Tonomy Developer Docs
  • Introduction
    • Features
  • Build Web4 Apps
    • Install
    • Register your Web4 App
    • Login
    • User Data and Logout
    • Sign Verifiable Credentials
    • Server Authentication
    • Smart Contracts
      • Develop
      • Deploy
      • 1-Click Transactions
      • Wallet Signing
    • Send P2P Messages
    • Troubleshooting
  • Multi-Chain Transactions + Crypto
    • Wallet Connect
    • Antelope Sigining Request (ESR)
  • Run Tonomy Infrastructure
    • Overview
      • Configuration
      • What software to run?
    • Node Setup
      • Setup
      • Run an API Node
      • Run a Block Producer Node
      • Becoming a Block Producer on Tonomy
    • API Endpoints
    • Hardware Requirement
    • Troubleshooting
  • Connect as an Exchange
  • Run Tonomy Gov OS
    • Technical requirements
    • Deploy Tonomy ID
    • Deploy a web wallet with the SDK
    • Reference
      • Application Interface (API)
      • Software Development Kit (SDK)
    • Troubleshooting
Powered by GitBook
On this page
  • Client-side
  • Server-side
  1. Build Web4 Apps

Server Authentication

Tonomy SDK allows apps to authenticate users to their backend servers without relying on centralized identity providers. This provides cryptographic proof-of-identity for secure API requests, data access, and user actions.

Client-side

const jwt = await user.createClientAuthorization({
    username: await user.getUsername(),
    foo: "bar"
});
// Securely send the jwt string to your server

Server-side

import { verifyClientAuthorization } from '@tonomy/tonomy-id-sdk'

// receive JWT string from the client
const verifiedUser = await verifyClientAuthorization(jwt);

You can also use the same flow above to send all requests, which adds integrity protection and non-repudiation to all requests to your server.

Why use it?

  • Proof-of-Identity for backend actions (e.g., payments, data storage)

  • Non-repudiation: Know exactly which user made the request

PreviousSign Verifiable CredentialsNextSmart Contracts

Last updated 1 month ago