简体   繁体   中英

How to login into facebook and twitter from link in php?

i have my username and password for facebook and twitter and i want to login facebook and twitter from my php page by providing username and password in anchor tag. how to do that?


    a href="https://www.facebook.com/login.php?login_attempt=1&email=abc@yahoo.com&pass=abc">Facebook /a>
    a href="https://twitter.com/login/?username=abc@yahoo.com&password=abc">Twitter /a>

Your approach is wrong. You should never pass password in query string.

Instead, to achieve Single Sign On (SSO) with Facebook or Twitter, You should use OAuth 2 . Both Twitter and Facebook (and several others, such as google, Linkedin etc.) support OAuth 2

For Facebook, there are several ways to create a Login easily. Of course you can use OAuth directly, but i would not recommended it:

General info: https://developers.facebook.com/docs/facebook-login/

For Twitter, this thread may help you: Authentication for new Twitter API 1.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM