🆔 Identity API methods allows developers to perform various user identity and account functionalities, such as getting the identity (DID) of a user (address), linking new addresses to the DID, and adding new authentication methods to the DID.
Static
Stateful
box.DID
Get the configuration of a 3Box.
Kind: static method of Box
Returns: Object
- An object containing the 3Box configuration for the given user. The object contains address links and DIDs for spaces.
Param | Type | Description |
address |
| The ethereum address, or DID |
opts |
| Optional parameters |
opts.profileServer |
| URL of Profile API server |
const config = await Box.getConfig(0x234...)console.log(config)
{"spaces": {"spaceName1": {"DID": "did:3:bafyreig4tg..."},"spaceName2": {"DID": "did:3:bafyjfr982d..."}},"links": [{"type": "ethereum-eoa","message": "Create a new 3Box profile...","version": 1,"signature": "0x04501e914651...","timestamp": 1563976242}]}
Verify a claim and return its content. See https://github.com/uport-project/did-jwt/ for more details.
Kind: static property of idUtils
Returns: Object
- The validated claim
Param | Type | Description |
claim |
| |
opts |
| Optional parameters |
opts.audience |
| The DID of the JWT's audience |
Check if a string is a muport DID.
Kind: static method of idUtils
Returns: *
| boolean
- If the address is a muport DID
Param | Type | Description |
address |
| A string containing a user profile address |
Check if a string is a valid claim.
Kind: static method of idUtils
Returns: Promise.<boolean>
- If the parameter is a verifiable claim
Param | Type | Description |
claim |
| |
opts |
| Optional parameters |
opts.audience |
| The DID of the audience of the JWT |
Get the DID of a 3Box.
Kind: instance property of Box
Properties
Name | Type | Description |
DID |
| the DID of the user |
Signs a JWT claim which can be verified by the did-jwt library.
Kind: instance method of Box
Returns: String
- A JWT string
Param | Type | Default | Description |
claim |
| | The content of the claim |
Creates a proof that links an ethereum address to a 3Box account (DID). If given proof, it will simply be added to the root store.
Kind: instance method of Box
Param | Type | Default | Description |
[link] |
| | Optional link object with type or proof |
[link.type] |
|
| The type of link (default 'ethereum') |
[link.proof] |
| | Proof object, should follow spec |
Checks if there is a proof that links an external account to the 3Box account (DID). If no params given and any link exists, this will return true.
Kind: instance method of Box
Param | Type | Description |
[query] |
| Optional object with address and/or type. |
[query.type] |
| Does the given type of link exist |
[query.address] |
| Is the given adressed linked |
Lists address links associated to a 3Box account (DID).
Kind: instance method of Box
Returns: Array
- An array of link objects
Remove given address link. Returns true if successful.
Kind: instance method of Box
Param | Type | Description |
address |
| address that is linked |