SIWW
  • Sign-in with Wallet (SIWW)
  • Specifications
    • Abstract
    • Motivation
    • Open source libraries
    • Security considerations
  • Use Cases
    • NodeJS - Backend implementation
      • 1. Setup passport-wallet
      • 2. Connect to SIWW
      • 3. Manage your authentication token
      • 4. Add authentication routes
      • 5. Code the views
      • 6. Full sample app
      • 7. Debugging and Q&A
    • ReactJS - connect to backend
      • 1. Add a login route
      • 2. Redirect the route to your backend
    • JS - Native calls to SIWW libs
      • 1. Initialize SIWW client lib
      • 2. Connect to a Wallet
      • 3. Create a message
      • 4. Send a message
      • 5. React JS App
    • Authenticating as an end-user
      • 1. Have a wallet available
      • 2. Connecting and signing
Powered by GitBook
On this page
  1. Use Cases
  2. JS - Native calls to SIWW libs

4. Send a message

The async_signMessage function sends a message to the wallet, for user signing. Several types of messages can be signed. At the moment, SIWC supports "authentication" and "revocation" types.

// Request the full message object ready to be signed by user
let objMsg = await this.siwc.async_createMessage(_idWallet, objCreate);

// now send message for user authentication
let objAuth = this.siwc.async_signMessage(_idWallet, objMsg, "authentication");

If successful, the API async_signedMessage will return an object with the following attributes:

  • connector: string ; the connector used for signMessage ("SIWC" for Cardano)

  • signature: string ; the COSE (cardano) signed message

  • key: string ; the COSE key

  • type: string ; the type of message ("authentication" or "revocation")

  • issued_at: string ; the UTC date time when the message was issued

  • valid_for: number ; how many seconds this message is valid for (from time of issued_at)

  • address: string ; the address of the signing entity (for sever validation)

Previous3. Create a messageNext5. React JS App

Last updated 2 years ago