Setting up and Managing a Gate
Setting up the Identity API to gate access
Creating Gates
Setting up a gate is easy with the *postGate endpoint. The values passed into the endpoint are the name
, type
and signInMode
.
The response from the endpoint has a vital key-value pair called secretKey
. Please keep this value safe.
Example Request
Key | Description |
---|---|
Name | Name of the gate |
Type | Type of authentication. Set to web3 by default |
signInMode | Amount of tokens needed to be held to authenticate |
Example Response
Key | Description |
---|---|
id | id of the transaction |
name | name of the gate |
clientId | unique GUID of the client as sent in from publishing API |
secretKey | generated as a response to gate creation and used for JWT token authenticity verification |
type | same as Type in request |
signInMode | Amount of tokens needed to be held to authenticate |
Create a new secretKey for a given Gate
We assume that you have kept your gate id secretKey for authentication: this is pretty important as it is what is going to convert the JWT token passed from the backend to data your application can read. If this
secretKey
wasn't saved, please use the *gates/{id}/secret endpoint to generate a new one.
Managing a Gate
Managing a gate can be done with the following endpoints:
- Get a Specific Gate by Id
- Delete a given gate by gate Id
- Get all the gates from the client
Get a Specific Gate by Id
This endpoint takes in the gateId
as its request body and returns a JSON object of the gate characteristics as its response body. The response is shaped like this
Key | Description |
---|---|
id | id of the transaction |
name | Name of the gate |
clientId | Unique GUID of the client as sent in from publishing API |
secretKey | Generated as a response to gate creation and used for JWT token authenticity verification |
type | Type of authentication. Set to web3 by default |
signInMode | Amount of tokens needed to be held to authenticate |
Delete a given gate by gateId
This endpoint allows the developer to delete an already created gate. It accepts the id of the transaction and returns a statusCode
of 0
when the operation is successful.
Similarities in success and failure
Success and failure JSON responses from this endpoint are similar in structure. Please be sure the endpoint returns a value that you want to use.
Get all the gates from the client
The endpoint returns all the gates set up in an environment in an array of JSON objects. It is a GET request with no values passed in as a request body. The returned value should look like this
Updated 5 months ago