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.

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

报告相同问题?