推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
shyrock
V2EX  ›  Python

让用户通过邮件链接免登录登入网站的问题,不知道该发哪个版,因为用 Python 先发这里了

  •  
  •   shyrock · Aug 19, 2021 · 1597 views
    This topic created in 1754 days ago, the information mentioned may be changed or developed.
    各位彦祖,
    有这么一个应用场景:当网站上一个事务需要某人推动时,发送一个邮件链接给某人,点击该链接会免登录进入网站

    我观察到很多网站会生成一个很长的 hash 串附在链接后面,
    猜测是把收件人的登录凭证和待处理事务的地址都放在了串中。

    不知道这种工作是不是有专门的技术术语以及参考实现呢?
    Grouie
        1
    Grouie  
       Aug 19, 2021 via iPhone
    可以用 jwt 生成个 token
    2i2Re2PLMaDnghL
        2
    2i2Re2PLMaDnghL  
       Aug 19, 2021
    不建议这么干,电子邮件在互联网上是明文传输的。
    不过有名字? Token Based Authentication
    jenlors
        3
    jenlors  
       Aug 19, 2021
    可以是一个映射,并且设置有效期
    shyrock
        4
    shyrock  
    OP
       Aug 19, 2021
    @long2ice #3 有具体点的参考实现吗?或者现成的库?
    shyrock
        5
    shyrock  
    OP
       Aug 19, 2021
    @Grouie #1 收到,我先看一下 pyjwt
    shyrock
        6
    shyrock  
    OP
       Aug 19, 2021
    @2i2Re2PLMaDnghL #2 谢谢提示,这个 token 不用邮件那怎么传?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3329 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 11:06 · PVG 19:06 · LAX 04:06 · JFK 07:06
    ♥ Do have faith in what you're doing.