隐式验证流-未在重定向上附加访问令牌-iOS [英] Implicit Auth. Flow - No Access Token Appended on Redirect - iOS

查看:89
本文介绍了隐式验证流-未在重定向上附加访问令牌-iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Instagram API创建了一个使用客户端(隐式)身份验证的Web应用程序.

I made a web app with Instagram API that uses Client-Side (Implicit) Authentication.

我将用户重定向到

https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token

,然后将显示Instagram登录页面.通常,Instagram会将应用程序重定向到

and the Instagram log-in page appears. Normally, Instagram redirects the app to

http://your-redirect-uri#access_token=ACCESS-TOKEN

我抓取了access_token以在应用程序中使用它.这可以在我的PC上的Chrome,Firefox和Edge中使用.

And I grab the access_token to use it in the app. This works in Chrome, Firefox, and Edge on my pc.

但是,重定向在我的iPhone 6上不起作用.我同时尝试了Chrome和Safari. 重定向的地址原来是未附加#access_token的地址,即:

However, the redirection doesn't work on my iPhone 6. I tried both Chrome and Safari. The redirected address turns out to be the one without #access_token appended, i.e:

http://your-redirect-uri

这与安全有关并且无法正常工作,还是我错过了一些东西?

Is it something to do with security and impossible to work, or am I missing something?

推荐答案

要在iOS上进行正确的重定向,重定向URI必须以/结尾.

Turns out the redirect URI has to end with a / for proper redirection on iOS.

这篇关于隐式验证流-未在重定向上附加访问令牌-iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆