Best practices - store Twitter credentials or not?

前端 未结 4 1472
故里飘歌
故里飘歌 2020-12-19 20:55

I\'d like to be able to give my users the ability to display their recent tweets on their profile on my website.

I have a PHP twitter wrapper and understand how to m

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-19 21:33

    You should never store unencrypted credentials of any kind. If your solution involves holding onto a plaintext password, even for a brief time, you need to rework something.

    Absolute best practice would be to hold no information yourself - use cookies or OAuth to handle your authentication. A session token or cookie can be disabled by the user at will, giving them control over the behavior of your site.

    Next best thing (although still pretty undesirable) would be to hold non-reversibly encrypted credentials to resend to Twitter whenever you need to display tweets.

提交回复
热议问题