dtbrd80422 2015-06-15 18:20
浏览 33

自动将用户登录到Laravel 4应用程序的URL

I did not find help on Google because I don't know what keywords to search for. What I have tried did not bring results?

I have a Laravel 4 application with users that can log in.

In a partner's application where user also can login I want to show them a custom link and when they click on it they should be redirected to my app and automatically be logged in. So I need to pass the user credentials somehow through the URL of the link that I show them. Of course if someone gets hand on that URL he can log in as well so there needs to be some security (only valid for one login, valid only for a certain time... I don't know yet what's best practice here).

  1. How is such thing called? I would like to do some more research.
  2. How would I realize this? Are there any Laravel libraries?
  • 写回答

1条回答 默认 最新

  • douzi115522 2015-06-15 18:52
    关注

    Sounds like you could make use of OAuth for your scenario.

    However, if you want a quick and simple solution, just do exactly what you described. Create a PartnerController with two methods. First one would be a service for your partner's app to ask for an authorization key which would be saved in a table. Then the second method could find the related user, login, and mark the authorization key as used.

    评论

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用