https://github.com/aergoio/user-auth
Account authentication for DAOs
https://github.com/aergoio/user-auth
authentication blockchain
Last synced: 12 months ago
JSON representation
Account authentication for DAOs
- Host: GitHub
- URL: https://github.com/aergoio/user-auth
- Owner: aergoio
- Created: 2022-03-25T02:08:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-28T01:20:59.000Z (over 4 years ago)
- Last Synced: 2025-01-01T06:12:37.672Z (over 1 year ago)
- Topics: authentication, blockchain
- Language: Lua
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# User Auth
This contract allows web apps to authenticate the user/account
It works with DAO accounts too
## How to Use
The dApp generates a unique id and inform that id to the user
The user sends a transaction to the `user-auth` contract informing the unique id
```
call(user_auth, "approve", unique_id)
```
The contract will emit an event on the blockchain containing the unique id and
the user account address
```
"approve", unique_id, account_address
```
The dApp must listen to events from the `user-auth` contract. Once it receives
the `approve` event it can check if it matches some unique_id it is waiting for
and also check if the account address matches the user's account address
### Contract Addresses
| Chain | Address |
| ------- | ------- |
| Mainnet | [AmhBGafBM3UrR3Mxr7tY2ibRhrCAX7zJVafeMcLBrdKbiBY2Mb2o](https://mainnet.aergoscan.io/account/AmhBGafBM3UrR3Mxr7tY2ibRhrCAX7zJVafeMcLBrdKbiBY2Mb2o/?tab=interactive) |
| Testnet | [AmgzdhMNCfCWpWMqout9aammdTzP7Q8X7Nx3pn9FCrAmzPYJDhJ7](https://testnet.aergoscan.io/account/AmgzdhMNCfCWpWMqout9aammdTzP7Q8X7Nx3pn9FCrAmzPYJDhJ7/?tab=interactive) |
| Alphanet | [AmgvjL9oTdPAgEJSwknqTXy1jMRsSXEn8DBWXqezLUx1AmpS1j7Q](https://alpha.aergoscan.io/account/AmgvjL9oTdPAgEJSwknqTXy1jMRsSXEn8DBWXqezLUx1AmpS1j7Q/?tab=interactive) |