ifconfig
V2EX  ›  PHP

PHP 下 API 接口安全,大家怎样做的?

  •  
  •   ifconfig · May 13, 2015 · 6843 views
    This topic created in 4038 days ago, the information mentioned may be changed or developed.
    不可能每次都传user_id吧,目前是想让前端登录后提供access_token.而且这个token一段时间后会换
    然后TP框架下了解到有OAuth,但是实现起来有点麻烦,鄙人有点笨看不懂,哭.......
    Larval可以用jwt-auth,但是这个包不稳定,经常出小问题,现在发现post提交不能拿到token。

    所以跪求各位安全这方面大家如何解决的,或者用哪些包解决的?
    14 replies    2015-05-14 15:55:56 +08:00
    moro
        1
    moro  
       May 13, 2015
    签名,参考支付类接口
    wy315700
        2
    wy315700  
       May 13, 2015
    session
    GuangXiN
        3
    GuangXiN  
       May 13, 2015
    access_token的意义约等于session_id
    lijinma
        4
    lijinma  
       May 13, 2015
    oauth2.0 access_token https
    lijinma
        5
    lijinma  
       May 13, 2015
    Laravel 我用的 dingo/api 直接支持 oauth2.0,你只需要搞一个 https 就好了
    lvfujun
        6
    lvfujun  
       May 13, 2015
    如果不是机密数据. access_token 足够了.
    vibbow
        7
    vibbow  
       May 13, 2015
    直接双向ssl认证......
    huigeer
        8
    huigeer  
       May 13, 2015
    ssl + 1
    kslr
        9
    kslr  
       May 13, 2015
    token
    oauth2
    rsa
    gdtv
        10
    gdtv  
       May 13, 2015
    我以前问过类似的问题,楼主可以参考一下:
    https://sunp.eu.org/t/166882
    crayhuang
        11
    crayhuang  
       May 13, 2015
    token+signature
    michaelzlies
        13
    michaelzlies  
       May 14, 2015
    验证的时候用header

    Authorization: Bearer {token}
    ifconfig
        14
    ifconfig  
    OP
       May 14, 2015
    @michaelzlies 方便留下企鹅号问你具体问题吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   975 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 68ms · UTC 20:36 · PVG 04:36 · LAX 13:36 · JFK 16:36
    ♥ Do have faith in what you're doing.