Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 11-28-2012, 10:55 AM   #1
tBunnyMan
Enthusiast
tBunnyMan began at the beginning.
 
tBunnyMan's Avatar
 
Posts: 39
Karma: 10
Join Date: Feb 2012
Location: Las Vegas, NV
Device: nook Simple GlowLight
Lightbulb Handling oAuth APIs

The new Pocket api for pulling stories is great but they are pushing all developers into switching to oAuth instead of username and password.

Since Calibre recipes don't store anything nor do they normally jump up prompts for users I was wondering the best way to tackle this. Has anyone else used an oAuth based API for pulling stories?

For now I should be able to squirm around it in the transition period but they will inevitably kick everyone over to the full api.
tBunnyMan is offline   Reply With Quote
Old 11-28-2012, 11:40 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,628
Karma: 4998489
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I've never used oauth, but why should handling it be any different from username/password? Simply have the user enter their oauth credentials in the username and password fields.
kovidgoyal is online now   Reply With Quote
Old 11-28-2012, 12:54 PM   #3
tBunnyMan
Enthusiast
tBunnyMan began at the beginning.
 
tBunnyMan's Avatar
 
Posts: 39
Karma: 10
Join Date: Feb 2012
Location: Las Vegas, NV
Device: nook Simple GlowLight
OAuth is a token based auth system. The short of it is that instead of passing a username and password you are supposed to send the user to a webpage where they authenticate then authorize your app. After they authorize it sends you back a token you are to keep and use for all actions.

My best idea, which isn't too bas, is to throw an error if the token is invalid (or missing) that tells the end user to go to the page and create the token and put it in the password field.
tBunnyMan is offline   Reply With Quote
Old 11-28-2012, 09:36 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,628
Karma: 4998489
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can also add a message in the description of the recipe telling the user how to get the oauth credentials.
kovidgoyal is online now   Reply With Quote
Old 11-29-2012, 03:15 AM   #5
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
The Goodreads Sync plugin uses the OAuth libraries for communication to Goodreads, if you are looking for a precedent for how it is used, though I know absolutely nothing about recipes and what you would do to integrate it with those. It does require the OAuth libraries, which are fine to include with the likes of a GUI plugin, but not sure how that would work with recipes. Perhaps Kovid would have to bundle them with calibre.
kiwidude is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Touch handling the dictionaries tshering Kobo Reader 17 10-19-2012 02:35 PM
calibre internal APIs:max_articles_per_feed & oldest_article iray1991 Recipes 0 01-31-2012 08:05 PM
PDF Handling tswan Which one should I buy? 1 09-30-2011 06:30 PM
composite_formatter and eval_formatter APIs deprecated chaley Development 0 06-26-2011 09:53 AM
Metadata Handling in 0.7.+ tonyc46 Calibre 2 06-23-2010 05:35 AM


All times are GMT -4. The time now is 06:03 AM.


MobileRead.com is a privately owned, operated and funded community.