Verida Documentation
  • Welcome
  • Network Overview
  • Start Building
  • Verida Wallet
  • Whitepapers
  • Glossary
  • Protocol
    • Core concepts
      • Design Principles
      • Decentralized Identity
      • Confidential Databases
      • Confidential Compute
      • Accounts and Identity
      • Data Storage
      • Application Contexts
      • Messaging
      • Schemas
      • Data Sharing
    • Client SDK
      • Getting Started
      • How It Works
      • Authentication
      • Data
      • Queries
      • Permissions
      • Messaging
      • Account Profiles
      • Events
      • Command Line Tools
      • Configuration
      • React Native
      • Advanced
    • Verida Connect SDK
      • Getting Started
      • WebUser
      • WalletConnect Support
      • Authentication Server
    • Blockchain Bridge
    • Run a Node
      • Database Node
        • Setup
        • Operations
        • FAQ
      • Compute Node
    • Verida Networks
  • Extensions
    • Credentials
      • Verifiable Credentials Developer SDK
      • cheqd Credential Service
      • Privado ID (fmr Polygon ID)
      • zkPass credentials
      • Reclaim Protocol credential
    • Verida URIs
    • Vue Components
Powered by GitBook
On this page
  • Usage​
  • Configuration​
  • Security​
  • Production​

Was this helpful?

  1. Protocol
  2. Verida Connect SDK

Authentication Server

PreviousWalletConnect SupportNextBlockchain Bridge

Last updated 7 months ago

Was this helpful?

The is a web socket server that bridges connections between a mobile device and a web page to enable a secure authentication using private blockchain keys stored on the mobile device.

This is similar to how WalletConnect bridges between a mobile wallet and a web application for blockchain transactions, however Verida enables database storage connections. In the future, it may be possible to leverage WalletConnect with additional extensions to replace this infrastructure.

Verida is currently running a server for both Verida Banksia and Myrtle that is used by default by all applications.

Usage

To start your application, use npm run start

Configuration

There is an example configuration file located in src/config/index.example.js. Copy this file to src/config/index.js.

You must update AUTH_URI to match the domain name / IP address of the server. You will also need to configure the Auth Client library to use this value as the serverUri. See

You must configure each application this server will support in the CONTEXTS section. You can specify a different private key per context. All data is encrypted and signed using the private key. This enables the data to be decrypted by the end user and in the future, will enable Application Contexts to be registered to specific keys, providing enhanced man-in-the-middle attack protection.

You must specify valid DID_CLIENT_CONFIG if you are registering a new Verida Account (DID) with the private key of a context. See

Security

The configuration file allows you to provide the private key of a valid blockchain account that can sign messages relating to the login process.

There is a loginOrigin property that, if specified, will check the origin HTTP header from each socket request to ensure it’s coming from the expected domain. This ensures third-party websites can’t easily request valid authentication tokens. This also ensures third party websites can be prevented from using the resources of any auth server that is running.

Malicious third parties could obtain a token by spoofing the origin HTTP header and then presenting that to the user. However, this loginOrigin property is passed inside the encrypted payload to the Verida Wallet and is displayed to the user. This allows the user to visually verify the domain name they are currently on matches the domain name displayed on the Verida Wallet login screen. In the future, the Verida Trust Framework will add an additional layer of security by matching on chain metadata against the public key and domain name used to sign the payload.

Production

Starting the server:

cd <vault-auth-server-location>
pm2 start ~/.nvm/versions/node/v12.14.1/bin/yarn --name vault-auth-server -- serve

Restarting the server:

pm2 restart vault-auth-server -- serve

Stopping the server:

pm2 stop vault-auth-server -- serve

Monitoring the server:

pm2 monit

It’s also recommended to install pm2-logrotate which is useful to manage logs on the server.

We recommend using the package to manage running the server.

PM2
Verida Vault Authentication Server
​
​
​
​
Client SDK / Authentication / Private Key.
Verida Connect SDK / Getting Started /Configuration.