issue in fetching yahoo contact list in iOS - iphone

yos-social-objc-master
I have also the problem with yos-social-objc-master project i found in github. after login with yahoo credential. I always got a page and a code xxxx with below lines
"To complete sharing of yahoo! info with xxxx, enter code xxxx into xxxx"
So, I am not getting that where I should enter this code? And how will it redirect to my application.
So that I can get contact list. I have done R&D on it. but didnt get any appropriate solution. Please help me out,how can i resolve this issue.

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> Pest the following code in it-
<?php
$query = $_SERVER['QUERY_STRING'];
header("Location: YOUR_APP_ID_OR_BUNDLE_ID://oauth-response?" . $query);
?>
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.
And then use YQL to fetch contacts.

Related

How to redirect from Yahoo to my IOS app after authentication?

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.
This is what I had done in my URL Schemes
where JCzOzd44 is my app ID.
In yahoo account while creating the app.what should I give in "Application Domain"
I didn't work with the Yahoo! API yet, but in oauth it works like that:
Create an url scheme in your app. You can do that in the Info section of your project settings (URL types). Name the scheme whatever you want, for example your app id.
When you authenticate your app, you can pass a parameter named oauth_callback. Here you have to pass the name of the just created url scheme.
This should be it - when the login is ok on the Yahoo side, it will try to open the app that is registered for the url scheme it got as callback parameter.
UPDATE:
From the Yahoo! API documentation - this is the call you do when requesting the oauth token somewhere in your code (I filled in your url scheme as the callback, this is how it should look like):
https://api.login.yahoo.com/oauth/v2/
get_request_token?oauth_nonce=ce2130523f788f313f76314ed3965ea6
&oauth_timestamp=1202956957
&oauth_consumer_key=123456891011121314151617181920
&oauth_signature_method=plaintext
&oauth_signature=abcdef
&oauth_version=1.0
&xoauth_lang_pref="en-us"
&oauth_callback="JCzOzd44://"
Of course the request should be signed.
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);
>
Where "com-mycompany-myapp" is your bundle identifier
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.
In your code
[self.session sendUserToAuthorizationWithCallbackUrl:#"http://yourdomain.com/YRedirect.php"];
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.
Thanks for this valuable information. Following your instructions I got the auth & call back working and the php page loads the app.

Magento Checkout is stuck on Billing information step

I am new to the magento, and right now, i was working one website.
I did my initial development on my local machine and everything was fine. few days ago I moved the website into test server from my localhost. after that the checkout function is not working properly.
the problem is that i have almost have nothing on that page.
if user is not logged in, then he(she) sees 2 steps as log in, and billing information, but without content. only the titles.
if user is logged in, then he(she) sees step 1 billing information title, and again no content
the website is http://guerrilla.webionaria.com/
user:teste#mail.ru
password:testtest
can anyone help me with this please
There is a 'Fatal error' on your page.
The rendering stops with
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id',
The error appears in app/design/frontend/{interface}/{theme}/template/checkout/onepage/billing.phtml or in app/design/frontend/{interface}/{theme}/template/persistent/checkout/onepage/billing.phtml (if you have cart persistence enabled).
In both of the cases, for some reason this code gives an error:
<?php echo $this->helper('directory')->getRegionJson() ?>
To find out what the error is you need to enable error reporting and display_errors.
You can do that from index.php.
error_reporting(E_ALL | E_STRICT);
...
ini_set('display_errors', 1);
You can also enable the developer mode by changing this:
if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
}
to this
//if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
//}
Then try again. If the error does not appear on your screen look at the source of the page.
If the error does not tell you anything update the question with its contents.
Just installed Magento for the first time on my Localhost. And found the same problem. I found the solution in following way:
-- Enabled the error logs in System > Configuration > Developer Tools
-- Then attempted a checkout.
Bam! found the error in var/logs/system.log
The error was due to SOAP. I needed to enable PHP's soap library. And it proceeded well.
Hope it helps someone :)

Facebook authentication tutorial missing piece

For the past 2 days I've been struggling trying to successfully authenticate users into my Facebook app. What I want to achieve in the end is to retrieve and store the access token of an user.
The problem I have comes by following the FB tutorial for authentication: http://developers.facebook.com/docs/authentication/
Just above the Client-side Flow section there is a snippet of code which should allow me to get the current user. Unfortunately, I only get an error:
Warning: file_get_contents(https://graph.facebook.com/me?access_token=) [function.file-get-contents]: failed to open stream: No route to host
Traced the error back to the point I can, and apparently there is an error on this line:
$response = #file_get_contents($token_url);
because if I echo the $response, I get nothing.
What is there not mentioned in the tutorial that I should be doing but I'm not because I have no idea I should do it?
Many thanks
You can achieve getting the access Token by
// Get the current access token
$access_token = $facebook->getAccessToken();
//And now echo the access token
echo $access_token;
Well, it got sorted in the end. Apparently it's a server problem. I tried developing the app on 2 different servers + locally (EasyPhp 5.3.8.1). On the 3rd server I tried it works for now (fingers crossed). Honestly, I have no idea why it's working now and why my local server didn't function as it should have. Well, it works for now :D

IMAP "Invalid Credentials" via GMail XOAUTH

I'm trying to get into the IMAP server with OAuth, using the PHP Sample Code provided by Google which uses the Zend Imap class but I am failing to authenticate. Zend is giving me the error:
Zend_Mail_Storage_Exception [ Error ]: cannot select INBOX, is this a valid transport?
Annoyingly this is a rather confusing error message, for what is essentially "Invalid Credentials". How did I know that? By debugging the actual commands being send to the IMAP socket I see this:
string(44) "NO Invalid credentials ey9if1544983wid.142
"
I have tried with telnet and a Ruby gmail_xoauth gem which suggests it is not a code issue, but something else.
Looking at the most basic level of all this, I am getting commands like this:
TAG1 AUTHENTICATE XOAUTH R0VUIGh0dHBzOi8vbWFpbC5nb29nbGUuY29tL21h......etc
This is where I get NO Invalid credentials then:
TAG2 SELECT "INBOX"
This returns BAD Unknown command and kicks me out.
I have tried searching around for people having the same problem but I find only questions and no answers. There are a few similar StackOverflow questions:
One post shows somebody having the exact same problem in Python.
This post shows somebody trying to be awkward and do it with OAuth 2, with no report of success.
There is a thread on the GMail Google Group that suggests an "Invalid Credentials" error can be resolved by going to https://accounts.google.com/DisplayUnlockCaptcha for GMail accounts and https://www.google.com/a/[YOURDOMAIN.COM]/UnlockCaptcha if you are using Google Apps, but the latter just said that my username and password were wrong when they clearly were not. Using this https://accounts.google.com/DisplayUnlockCaptcha worked fine - even though my account is a hosted App, not plain old GMail - however I still get the same errors when trying to log back in with the PHP sample code provided by Google.
I've tried with various hosted Google App accounts and a plain GMail account. I've tried switching the IMAP server from imap.gmail.com to imap.googlemail.com, nothing makes any difference.
/**
* Make the IMAP connection and send the auth request
*/
$imap = new Zend_Mail_Protocol_Imap('imap.googlemail.com', '993', true);
$authenticateParams = array('XOAUTH', $initClientRequestEncoded);
$imap->requestAndResponse('AUTHENTICATE', $authenticateParams);
/**
* Print the INBOX message count and the subject of all messages
* in the INBOX
*/
$storage = new Zend_Mail_Storage_Imap($imap);
echo '<h1>Total messages: ' . $storage->countMessages() . "</h1>\n";
For those with an interest, this is the specific PHP code that sets up the connection, all XOauth is handled by Google's PHP in the same file but I skipped it.
I had this exact same error, and eventually realised I was using the wrong scope when requesting the OAuth permissions.
You need to have...
scope=https://mail.google.com/
access_type=offline
And also IMAP enabled in your Gmail account obviously. All seems good now.
One problem you may have is that the third parameter of Zend_Mail_Protocol_Imap('imap.googlemail.com', '993', true); should not be true. It should be a string, as either "SSL" or "TLS". I believe you want "SSL" if going over port 993. It's only a boolean when it is FALSE.
Try replacing that first line with this:
$imap = new Zend_Mail_Protocol_Imap('imap.googlemail.com', '993', 'SSL');
When i had this same error message, it was because
$options['consumerSecret'] = $THREE_LEGGED_CONSUMER_SECRET_HMAC;
I was doing that in a function and variable $THREE_LEGGED... wasn't in the scope. Pretty stupid and i'm sure that you'd have spotted that but just in case somebody new is reading that.

IE and Facebook signed request

For some odd reason, i do not receive a "signed_request" when using IE. If i use the same application in firefox/chrome i get the signed request! has anyone had this problem and is there a solution.
I tried to search it up, but i can never get anything close to what i am asking (signed_request usually just takes over search and i get a bunch of documentation on how to parse it).
So i decided, well this is strange!
<?php print_r($_POST) // or request ?>
I made this as a page. In FF and Chrome, both give me the post information, but IE does not give me anything... just
Array( )
Thanks!
signed request is the included for case where user access your content via facebook. That should be signed to the server... and therefore it should not depends on the client browser. check you code to see if you have done something like redirecting the request when the session / user is invalid.
A solution that worked for me was to put this header in my tab page:
<?php
header('P3P: CP="CAO PSA OUR"');
header('P3P: CP="HONK"');
?>
I've found this solution here: http://hasin.me/2011/09/30/story-about-blue-e-iframed-web-application-wastage-of-6-hours-and/