sociallayer-im / product-management

social layer product issue tracker
0 stars 0 forks source link

nodejs api for sign-in with ethereum #225

Open jiangplus opened 1 month ago

jiangplus commented 1 month ago

开发基于nodejs/deno服务,进行以太坊登录的验证

输入数据信息 message,signature,返回 boolean

参考:

https://github.com/spruceid/siwe-quickstart/tree/main/02_backend

Cupnfish commented 1 month ago

@jiangplus

这个需求的实现基本完成,但有几个细节需要确认:

  1. siweMessage验证:我们是否要限制特定的域名(比如mobit.app)才能返回true?

  2. 时间参数验证:对于issuedAt等参数,是否要验证当前时间必须在5分钟内?超出这个时间范围就不通过?

  3. 前端App的服务:具体是要给哪个前端应用?有没有对应的origin设置要求?

等你回复,方便进一步调整。

谢谢!

jiangplus commented 1 month ago

nonce 和域名作为一个参数返回吧,backend 自己判断用在什么域名 可以有15分钟时间限制

Cupnfish commented 1 month ago

https://github.com/sociallayer-im/verify

Cupnfish commented 1 month ago

https://siwe-verify.deno.dev/nonce