vevlins

命令行工具打开浏览器登录实现鉴权的原理是什么?

  •  
  •   vevlins · Oct 31, 2022 · 1480 views
    This topic created in 1344 days ago, the information mentioned may be changed or developed.

    类似于腾讯云开发 cli 等一些工具,可以在 xxx login 命令后拉起一个页面,页面登录后命令行完成鉴权。命令行跟浏览器是怎么交互的?

    vevlins
        1
    vevlins  
    OP
       Oct 31, 2022
    自抛自扣,搜到解决方案了,跟检测本地 QQ 是否登录的原理差不多。
    https://www.altostra.com/blog/cli-authentication-with-auth0

    本地启动一个服务 xxxx ,页面登录完成后回调 localhost:xxxx ,然后把动态口令存下。
    vevlins
        2
    vevlins  
    OP
       Oct 31, 2022   ❤️ 1
    再提供一个思路,也可以生成一个带随机串的链接,把随机串写入本地当作 token ,打开链接时把 token 和登录用户绑定。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3800 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 04:24 · PVG 12:24 · LAX 21:24 · JFK 00:24
    ♥ Do have faith in what you're doing.