DApiAuth
DApiAuth is a library used to implement blockchain-based authorization within Go APIs.
Each caller is registered on the chain and every token is stored in the respective smart contracts of the endpoint. The process goes as following:
- The caller authenticates in the server.
- After authenticating the server registers the caller’s public address as an available token.
- The server sends the token to the caller.
- In order to access the remote endpoint the caller must go through the smart contract of the specified application with the specified token.
- The smart contract decides whether the token is valid and also if it has access to the specified route.
- The call is passed on to the endpoint by the smart contract and the result is sent back to the client’s public Ethereum address.