Quite a while ago (like, in at least 2009), I started thinking about regaining control of all the content I was producing online. I was posting photos to Flickr, saving bookmarks to Delicious. I started Tweeting. I was checking in. All fun and games, and all of those services offer great tools for interacting with them (let’s face it, tools that are much better than WordPress’, because they are focussed on one thing). So I figured, why not write importers for these services and pull my content back over to my WordPress. And keep doing it periodically, so that I could keep using those tools. I want WordPress to be my “home on the web”, my digital hub, but I want to use these neat tools with their fancy apps and what-have-you.
Very quickly, I realized that if I was going to do anything useful on most web services, I’d need to be able to authenticate with them. No biggie, right? I know my username and password… Oh. Right. OAuth. Turns out that most web services use OAuth (or something similar) to authenticate, and it turns out that that’s actually a bit of a bear to implement, when all you want to do is write a simple little Twitter importer. And then again for a Foursquare importer. And a Flickr importer.
What I needed was a shared, generic authentication framework that would do all the heavy lifting for me. I would tell it I wanted a connection to specific service, and if it didn’t have one, it’d walk the user through the process of getting one. It’d give me a standardized format of authentication credentials and abstract out all the complexity of making authenticated requests against those services. Then it would make me a coffee*. What I needed, was Keyring.
And so Keyring was born. Basically it’s a bunch of code that’ll handle external authentication with a web service so you don’t have to. It’ll store tokens/passwords/whatever, can talk to all kinds of different services, and is really, really extendable. It also has hooks. Lots of them. So if you want to do something custom, you probably can. It’s intended to be a foundation for writing other plugins, and really doesn’t do much interesting on its own.
I already have importers written for Twitter, Delicious and Foursquare which are based on Keyring and so far they’re working pretty nicely. There’s a lot of work to go on this project though. For Keyring to be a truly powerful framework, I need to:
- Drastically improve the UI, which is a hodge-podge of hideousness at the moment
- Improve a few parts of the Core UX which are pretty clunky right now
- Put in some more failsafes/helpers for making sure things are up and running before allowing plugins to use Keyring
- Improve internal security
- Tighten up Permissions/Roles restrictions all over the place
- Handle multi-user blogs (especially around token storage)
- Work on Multi-Site
- Support more services (preferences? suggestions?)
- Figure out a good way of allowing people to drop in their own Service extensions (and not overwrite them with updates)
- Improve the handling of auth flows in other plugins, and preferably move as much of that logic as possible into Keyring Core
I’m slowly working on this, but it’s all kind of a personal project at this point, so it’s just a few hours here and there. My main goal is to get it functioning so that I can get my content back. Once that’s done, then I’ll spend more time tightening it up for other/platform use. I also have a couple of other “companion plugins” that I’m working on — auto-linking text for Twitter @mentions and #hashtags, mining posts and downloading remote media (e.g. Instagram images) and some stuff around geo for mapping things like Tweets and Foursquare checkins (all the geo-data is imported in the importers I wrote).
Next on the list is abstracting and then releasing the importers that I have. That will give people something more tangible to use as an example. After that I’ll be working on a Flickr importer, but that’s a pretty big project in and of itself.
So, what do you think? Useful? Waste of time? Massive, gaping, horrendous holes? LMK (in the comments) and we’ll see what we can do.
And you know the drill — patches welcome 😉
* Sadly, Keyring will not make you coffee. Yet.