如何在身份验证后从Yahoo重定向到我的IOS应用程序? [英] How to redirect from Yahoo to my IOS app after authentication?

查看:120
本文介绍了如何在身份验证后从Yahoo重定向到我的IOS应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,我必须使用雅虎帐户登录。
我已经通过这个链接并按照程序进行了操作但是我在认证后无法回到我的应用程序。谷歌搜索后我找到了答案这里。他说在你的info.plist文件中添加一个URL方案使用YOUR_APP_ID_OR_BUNDLE_ID我做了同样的事情,但无法从雅虎重定向到我的应用程序。如果任何人都在努力,请帮助我。谢谢。

I am working on an app where I have to use Yahoo account to login. I had gone through this link and followed the procedure as it was there.But I am unable to get back to my app after authentication.After googling I found an answer here.Here he said that "Add an URL Scheme in your info.plist file with the YOUR_APP_ID_OR_BUNDLE_ID" I did the same,but unable to redirect from yahoo to my app.If any one worked on this please help me.Thanks in advance.

这是我在URL Schemes中做了什么

This is what I had done in my URL Schemes

其中JCzOzd44是我的应用程序ID。

where JCzOzd44 is my app ID.

在创建应用程序时在yahoo帐户中。我应该在应用程序域中给出什么

In yahoo account while creating the app.what should I give in "Application Domain"

推荐答案

我找到了解决方案虽然有一点开销。
步骤是:1>在您自己的服务器中创建一个PHP脚本(比如命名为YRedirect.php)。
2>将以下代码粘贴到其中 -

I have found the solution though with a little overheads. Steps are: 1> Create a PHP script in you own server (say named, YRedirect.php). 2> Paste the following code in it-

CODE
<?php
$query = $_SERVER['QUERY_STRING'];
header("Location: com-mycompany-myapp://oauth-response?" . $query);
>

com-mycompany-myapp是您的包标识符

Where "com-mycompany-myapp" is your bundle identifier

3>使用YOUR_APP_ID_OR_BUNDLE_ID在info.plist文件中添加URL方案。就是这样,你就完成了身份验证问题。

3> Add an URL Scheme in your info.plist file with the YOUR_APP_ID_OR_BUNDLE_ID. That's it and you are DONE with the authentication problem.

在你的代码中

[self.session sendUserToAuthorizationWithCallbackUrl:@"http://yourdomain.com/YRedirect.php"];

然后,从Info.plist文件中为您的iPhone应用程序注册自定义URL方案,然后设置您的服务器端脚本通过您刚刚设置的URL方案将Safari重定向回您的应用程序。

Then, register a custom URL scheme for your iPhone application from your Info.plist file, and then setup your server side script to redirect Safari back to your application via the URL scheme you just set up.

感谢您提供有价值的信息。按照你的指示,我得到了auth&回调工作,php页面加载应用程序。

Thanks for this valuable information. Following your instructions I got the auth & call back working and the php page loads the app.

这篇关于如何在身份验证后从Yahoo重定向到我的IOS应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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