i gotI had the the idea of ana secure alternative login process using an eosEOS smart contract instead usingof firebase or amazonAmazon cognito. I would like to know if something like this feasible?
My idea is somewhat like.
- serverServer creates cookie with a specific id
- serverServer sends cookie with id to client
- clientClient gets cookie with unique id from server
- clientClient wants to login so he executes a action "Login" from contract and writes the id he got formfrom the server in the form of a hash256SHA256 hash in the contract (contract writes the timestamp of execution also in the table)
- client sendClient sends message to the server when the action was successful that he wants to login.
- serverServer looks up the eosEOS contract table up for the name and if the entry is not older than 1-2sec and checks if the hashed id is the same as the server gave to the client.
- isIf everything is ok, the client gets a session and can see his private data or whatever the website returns.
(server could be something like node.js with express-session and reactjs/vue/angular as front-end)
iI don't know if this is a secure way to do this or an alternative for firebase auth and amazon cognito. I would also be interested in other thoughts,how how one could realize something like that.