Dav*_*son 5 android android-manifest
我构建了一个需要 OAuth 的 Android 应用程序。使用由 Android 拦截的自定义方案回调,一切运行良好。雅虎似乎已经更改了目标帖子,现在雅虎不接受自定义方案。
我现在正在寻找可能的替代方法。我的第一次尝试是使用普通的 http 方案并修改我的意图过滤器以拦截新的 URL。我的 AndroidManifest.xml 中有以下内容:
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="www.test.com" android:scheme="http"></data>
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
其中 www.test.com 将替换为我拥有的域名。它似乎 :
那么有人可以帮助我吗
感谢您的帮助。
另一个解决方案怎么样,在您的 www.test.com 上放置一个提取 oauth 参数并重定向到您的自定义方案回调的脚本?
例如 oauth.php (请原谅我的 PHP ...)
<?
header('Location:myschema://mythost?oauth_verifier='.urlencode( $_GET['oauth_verifier']).
'&oauth_token='.urlencode($_GET['oauth_token']));
die();
?>
Run Code Online (Sandbox Code Playgroud)
我成功地将它用于 Google OAuth,它对回调 URL 有相同的限制。
| 归档时间: |
|
| 查看次数: |
3528 次 |
| 最近记录: |