Skip to content

Authenticate to a server using your Ethereum wallet

License

Notifications You must be signed in to change notification settings

JoinColony/etherpass

Repository files navigation

etherpass

Authenticate against a node.js server. Use just your ethereum wallet to create cookies or tokens. For an example using JWT, see the examples directory.

Installation

Pretty sure you know what to do at this point. (hint: npm install etherpass)

Usage

We're exporting two functions:

getChallenge(address: string): string

Generates a challenge string that the client needs to sign using an ethereum wallet (personalSign). Then send this back to the server using another endpoint. This challenge is valid for 10 minutes.

verifyEthSignature(challenge: string, signature: string): string

Returns the address of the account which signed the message. Throws if something goes wrong. Use this address to generate a token or a cookie or whatever floats your boat.

See also Implementation.md for a quick sketch of what's happening.

Contributing

We welcome any contribution to this project. Feel free to open issues, PRs or ask questions! But please, adhere to our Code of Conduct!

License

MIT

About

Authenticate to a server using your Ethereum wallet

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published