duanne9313 2016-06-15 19:44
浏览 57
已采纳

Laravel在OAuth回调后访问JWT

I'm building an API using Laravel for a Swift iOS App. I'm using JWT to authenticate users from the app.

One part of the app is connecting 3rd party OAuth accounts such as Twitch. The issue I have is that my after an OAuth requests redirects to my callback, the user's JWT is no longer part of the request.

What would be the best way to preserve the JWT through a 3rd party OAuth request?

  • 写回答

1条回答 默认 最新

  • doushuangai9733 2016-06-15 21:20
    关注

    I've managed to solve this by doing the following:

    1. Intercept callback using UIWebViewDelegate
    2. Create mutable request from original callback request
    3. Append auth header
    4. Load the request again

    If there's a better solution to this, I'm all ears.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题