Saturday, April 17, 2010

ReaderScope 1.9 - OAuth

For past month or so, some of you (ReaderScope users) might be facing problems if you were using AutoLogin. This happened after I updated the login mechanism in v1.8.2 to support Google Reader authentication changes. I won't go into the details, but AutoLogin is very likely to fail in the new scheme of authentication. So I advised some of you who sent me the error reports to switch to Username/Password login. It was a temporary solution.

Today I am glad to announce that starting with v1.9 ReaderScope supports OAuth login for Google Reader - the right way to login without password (compared to other password less alternatives at least).

This has been possible only after Google Reader team enabled OAuth login for their service a few weeks ago. I have been working since to get ReaderScope working with OAuth. Not all the time was spent on OAuth, but in order to implement OAuth I had redesign entire networking layer of ReaderScope (which I am glad I did because I could improve some things along the way).

Finally RS with OAuth is ready. If you were still using AutoLogin, then after upgrading to v1.9 you will get a warning message that AutoLogin is no longer supported and you will be automatically logged out. On restart you will be taken to Login screen where you can start doing OAuth login.

If you are using username/password, then after upgrading to v1.9 you will get a message informing that a new password less login option is available. You won't be forcefully logged out though. You can choose to logout and relogin.

I have been testing most of the functionality in past couple of days. But I won't be surprised if some holes were left out. Please report any problems you might face or sent crash reports if you get any.

Enjoy the upgrade!


(``-_-´´) -- BUGabundo said...

i just logout of the old auth via pass, did the oauth steps, pasted the code, and pushed Procede, only to get a error:

I/ActivityManager( 143): Starting activity: Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat= }
D/webviewglue(21050): nativeDestroy view: 0x70c7b0
I/ActivityManager( 143): moveTaskToBack: 154
D/dalvikvm(19194): GC freed 12476 objects / 781880 bytes in 175ms

Jayesh said...

That looks like a temporary error. Can you try again? The error says the browser could not be started (for some unknown reason)

(``-_-´´) -- BUGabundo said...

i tried it several times, even closing RS in between.

maybe i'm doing it wrong! whats the *proper* way to leave the browser?

i tried back button till RS, and long press HOME to choose RS

Jayesh said...

Let me put down the steps that are expected

1. Login screen shows
2. You press 'OAuth Login' button
3. Browser opens, visits Google page. You get two buttons "Grant Access", "Deny Access"
4. You choose "Grant Access"
5. Google shows a page with the verification code
6. Using Menu>Select text, you copy the verification code
7. Press back 2 (or maybe 3) times to come back to ReaderScope Login screen.
8. The login screen now has 'Verification code' box. You long press it and paste the code.
9. You press the 'Proceed' button.

At this point only two possible things can happen
1. Successful Authentication: upon which the tags and subscriptions will automatically start downloading
2. Failure: You will see a toast saying "Authentication failed. Please try again". The "OAuth Login" button will reappear.

Do you see something other than this after pressing 'Proceed'?

(``-_-´´) -- BUGabundo said...

nope. i see the 2nd outcome!

btw that toast could be a long one, instead of the short. i can barelly read the error message

Jayesh said...

> nope. i see the 2nd outcome!

In that case, the pasted code is incorrect. Double check if you are not adding extra whitespaces before or after the code unknowingly.

Also the auth error at this point is getting logged in your logs. Unfortunately to see those logs you will have to get into the app, for which you will have to first login (you can use username/password for that).

If you do reach the log, email it to me, that will help.

(``-_-´´) -- BUGabundo said...

been using android for an year :)
i always take care with spaces!

i'll try again, and if i get an error, ill use user/pass login and send u the log.

Mariano said...

Jayesh, great job!

Does auto-relogin work in an OAuth scenario?

Jayesh said...

AFAIK, OAuth tokens never automatically expire (unlike the Auth token obtained from ClientLogin). Only when user explicitly revokes the access at service provider's site (Google in this case), will the oauth tokens become invalid. So there is no need for auto-relogin logic.

(``-_-´´) -- BUGabundo said...

hey Mariano.
Still having trouble with the OAuth code in NewsRob?

you guys should merge and make the BEST GReader sync app

Mariano said...

thanks. Sounds good. It would be great, if you let me know if you learn something new about this auto-login thing.

Bugabundo, never tried my hand on OAuth yet, but if the next Android OS version still doesn't offer a good solution I might try.
Sure, we go right on it ;-) I am travelling to India next week anyway, so we can start then ;-)

Jayesh said...

> I am travelling to India next week anyway, so we can start then ;-)

Cool. Welcome. Be prepared for some hot and humid weather though. Summer is not the best time of the year in this part of the world.

Mariano said...

Hehe, yeah, my coworkers in Pune already "warned" me, I even got a medical "alert" because of the weather from my employer.
But I have been there last August/September already and I am young(?) and healthy so I should be alright with >40°C ;)
I will be in A/Ced rooms most the time anyway.