Module: lib/protocol/authenticate

Module for Whiteflag authentication

Source:
Tutorials:

Methods

(inner) createSignature(signPayload, address, blockchain, callback)

Requests a authentication signature for the appropriate blockchain

Parameters:
Name Type Description
signPayload wfSignaturePayload

the signature payload object to be signed

address string

the address of the account for which the signature is requested

blockchain string

the blockchain for which the signature is requested

callback function

function to be called upon completion

Source:

(inner) decodeSignature(wfSignature, callback)

Decodes authentication signature

Parameters:
Name Type Description
wfSignature wfSignature

a Whiteflag authentication signature

callback function

function to be called upon completion

Source:
To Do:
  • Detailed error processing after JWT decoding

(inner) removeAuthentication(wfAuthMessage, callback)

Removes the authentication information of the message originator

Parameters:
Name Type Description
wfAuthMessage wfMessage

a Whiteflag authentication message

callback function
Source:

(inner) verifyAuthentication(wfAuthMessage, callback)

Checks the authentication information of the message originator and updates metaheader accordingly

Parameters:
Name Type Description
wfAuthMessage wfMessage

a Whiteflag authentication message

callback function

function called upon completion

Source:

(inner) verifyMessage(wfMessage, callback)

Checks if message can be authenticated and updates metaheader accordingly

Parameters:
Name Type Description
wfMessage wfMessage

a Whiteflag message

callback function

function to be called upon completion

Source:

(inner) verifySignature(wfExtSignature, callback)

Verifies authentication signature

Parameters:
Name Type Description
wfExtSignature wfExtendedSignature

an extended Whiteflag authentication signature

callback function

function to be called upon completion

Source:

Type Definitions

verificationData

Requests verification data of an authentication token for the specified blockchain address

Type:
  • string
Source:

wfExtendedSignature

A Whiteflag authentication signature object

Type:
  • Object
Properties:
Name Type Description
blockchain string

the name of the blockchain

originatorPubKey string

the blockchain account public key of the originator

wfSignature wfSignature

A Whiteflag authentication signature object

Source:

wfSignature

A Whiteflag authentication signature object

Type:
  • Object
Properties:
Name Type Description
protected string

Encoded signature header to identify which algorithm is used to generate the signature

payload string

Encoded payload with the information as defined in the Whiteflag protocol specification

signature string

The digital signature validating the information contained in the payload

Source:

wfSignatureDecoded

A Whiteflag decoded authentication signature object

Type:
  • Object
Properties:
Name Type Description
header Object

Signature header to identify which algorithm is used to generate the signature

payload wfSignaturePayload

Payload object of a Whiteflag authentication signature

signature string

The digital signature validating the information contained in the payload

Source:

wfSignaturePayload

A Whiteflag authentication signature payload object

Type:
  • Object
Properties:
Name Type Description
addr string

The blockchain address used to send the corresponding A1 message and of which the corresponding private key is used to create the signature

orgname string

The name of the originator, which can be chosen freely

url string

The same URL as in the VerificationData field of the corresponding A1 message

extpubkey string

The serialised extended parent public key from which the child public keys and addresses used by this originator can be derived (currently not supported)

Source: