dongtaihui5131 2015-06-14 00:45
浏览 228

LinkedIn登录为PHP页面的身份验证

I have built a website which I would like users to be able to only login with LinkedIn accounts. I managed the LinkedIn connection using this tutorial: http://thinkdiff.net/linkedin/integrate-linkedin-api-in-your-site/ however I am a bit stuck because I would like my php pages (home.php, account.php, etc..) to only be accessible if you are logged in via LinkedIn. So far I can login using LinkedIn (like the tutorial) but I can also access pages, which are supposed to be authorized using LinkedIn, directly from their URL.

I believe in order to accomplish this I have to store some authentication response from LinkedIn value in a session variable and then checking on each .php page, that is to be secured, to see if that value is set.

Any help would be great, as all the SO posts I have read regarding LinkedIn have hyperlinks to no longer existing API & code examples.

  • 写回答

1条回答 默认 最新

  • doumengbai2031 2015-06-14 01:56
    关注

    Yes. You need to store the login in the session variable and then put some PHP at the front of every page that you want to protect. This answer has the code you need.

    评论

报告相同问题?

悬赏问题

  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM