Module for Whiteflag authentication
- Source:
- Tutorials:
Methods
(inner) createSignature(signPayload, address, blockchain, callback)
Creates a authentication signature for the appropriate blockchain
Parameters:
| Name | Type | Description |
|---|---|---|
signPayload |
wfSignPayload | 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 |
requestSignatureCb | function called on completion |
- Source:
(inner) decodeSignature(signature, callback)
Decodes authentication signature
Parameters:
| Name | Type | Description |
|---|---|---|
signature |
wfSignature | a Whiteflag authentication signature |
callback |
genericCb | function called on completion |
- Source:
(inner) generateToken(authToken, address, blockchain, callback)
Requests verification data of an authentication token for the specified blockchain address
Parameters:
| Name | Type | Description |
|---|---|---|
authToken |
string | the secret authentication token in hexadecimal |
address |
string | the address of the account for which the signature is requested |
blockchain |
string | the name of the blockchain |
callback |
genericCb | function called on completion |
- Source:
(inner) removeAuthentication(wfAuthMessage, callback)
Removes the authentication information of the message originator
Parameters:
| Name | Type | Description |
|---|---|---|
wfAuthMessage |
wfMessage | a Whiteflag authentication message |
callback |
wfMessageCb | function called on completion |
- 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 |
wfMessageCb | function called on 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 |
wfMessageCb | function called on completion |
- Source:
(inner) verifySignature(wfExtSignature, callback)
Verifies authentication signature
Parameters:
| Name | Type | Description |
|---|---|---|
wfExtSignature |
wfExtSignature | an extended Whiteflag authentication signature |
callback |
endpointSignatureVerifyCb | function called on completion |
- Source:
Type Definitions
authRequestSignatureCb(err, wfSignature)
Parameters:
| Name | Type | Description |
|---|---|---|
err |
Error | any error |
wfSignature |
wfSignature | the Whiteflag JWS to be signs |
- Source:
authVerifySignatureCb(err, resultopt)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
err |
Error | any error |
|
result |
wfSignDecoded |
<optional> |
the verified and decoded signature |
- Source:
wfExtSignature
A Whiteflag extended authentication signature object
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
blockchain |
string | the name of the blockchain |
pubkey |
string | the blockchain account public key of the originator |
jws |
wfSignature | a Whiteflag authentication JWS object |
- Source:
wfSignDecoded
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 |
wfSignPayload | Payload object of a Whiteflag authentication signature |
signature |
string | The digital signature validating the information contained in the payload |
- Source:
wfSignPayload
A Whiteflag authentication signature payload object
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
addr |
string | The blockchain address used to send the corresponding |
orgname |
string | The name of the originator, which can be chosen freely |
url |
string | The same URL as in the |
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:
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: