15

This is a kind of re-post of my question on Yahoo! forums. It is just that I refer to StackOverflow more frequently...

My problem is as following: while Yahoo! OAuth http://developer.yahoo.com/oauth/ is described as ready for use with mobile phones out-of-the-box it does not appear as such.

I have tried to implement sample application and use Yahoo! PHP SDK to connect with Yahoo! Using web browser it is all nice and easy. But while visiting Yahoo! request_auth page (http://developer.yahoo.com/oauth/guide/oauth-userauth.html) on my test mobile phone (Nokia 6300) it renders unacceptable: I am not able to see login box, cannot read information why my login would be required and all. I just see a page border and some text fragments ("Yahoo!", "Hel" (like in help...) et. al.).

Is there some parameter to force Yahoo! displaying mobile phone optimised page? I do redirect user to this address at the moment: https://api.login.yahoo.com/oauth/v2/request_auth

BTW: if I use Opera Mini - it renders page nicely, although ommiting information about my site (which is requesting log-in). Just that I cannot force all users to use Opera, or something.

Thanks in advance for any help.

Justas Butkus
  • 533
  • 3
  • 9
  • Did you figure this out? – Nick Siderakis Jan 07 '12 at 15:26
  • 1
    @NickSiderakis - no, I shall admit, that I have not. After I have migrated to new API - something slightly changed, although I am still able to reproduce this behavior, and there was no response from Yahoo! staff, as far as I am concerned. – Justas Butkus Jan 10 '12 at 09:54

3 Answers3

4

I've looking for a solution to this all day and eventually stumbled upon this: http://pastebin.com/8tDnrfLc

Important bit reproduced below:

var authPageURL = "https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=" + oauthToken;
var yahooMobileLoginUrl = "https://login.yahoo.com/m?&.src=oauth&.lang=en-us&.intl=us&.done=" + authPageURL;

Basically you direct the user to the mobile auth page and give it a url to go to when it's done. That url should be the original https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=... url.

Works for me!

  • This is actually the new OAuth 2.0 version which has a mobile version for web login. However, OP is talking about the OAuth 1.0a which doesn't seem to have a web mobile page. OAuth 2.0 is unfortunately non-compatible with some Yahoo APIs yet (e.g. YQL). – Michael Ho Chum Aug 04 '14 at 20:01
  • Nvm, I just tested your technique with OAuth 1.0a and it's working, very clever! Thumbs up. – Michael Ho Chum Aug 05 '14 at 00:28
  • Thank you, this is a big help. Yahoo should be embarrassed that this hack is even necessary. It still is not a great user experience, because the approval page that comes next after login is not formatted properly for mobile. – Mason G. Zhwiti May 15 '15 at 16:37
1

Yahoo! no doubt has a user-agent sniffing algorithm that determines what constitutes a mobile browser. Clearly Opera Mini triggers the right behavior. I suspect the native browser in the Nokia model you are using is not on the list, or it is emulating a desktop browser user-agent. Unfortunately I think you have to convince Yahoo! to deem your Nokia 6300 a mobile device.

hoserdude
  • 831
  • 1
  • 6
  • 14
0

Perhaps modifying the user agent to make Yahoo! think the browser is Opera mini?

PowerAktar
  • 2,341
  • 1
  • 21
  • 17
  • How could I make all my clients do that? There are hundreds of thousands of them with thousands of different devices... It shall be _Yahoo!_ call argument, I think... – Justas Butkus May 22 '12 at 07:56