I’ve been wanting to use an OpenID implementation in a website ever since Stack Overflow came out. Tonight I finally got around to it, and ended up going with RPX as my OpenID solution provider. I’m sure I could have coded an implementation myself, or used one of the several available libraries. In the end I decided that if I was going to offload my authentication, I may as well offload as much as I can, and seeing as RPX is free to start there was no harm.
The quick start guide to getting up and running seemed easy enough. Insert a small script section, and insert a link or embedded IFrame pointing to my personal RPX sign in page.
|HTML |||copy code |||?|
<a class="rpxnow" href="https://mysite.rpxnow.com/openid/v2/signin?token_url=your_token_url">Sign In </a>
RPXNOW.overlay = true;
RPXNOW.language_preference = 'en';
This is very easy and quick to implement, however it doesn’t work. The problem is that the parameter token_url is obviously a placeholder. The documentation is clear that the url needs to be properly encoded, so that should not be a problem.
Great! But it still fails. I came up with 2 things that needed to change that were not in the documentation. In my RPX settings there is a section where you need to list all approved token_url domains, except it doesn’t go by domain name. It seems to do a string compare to the site you pass in, meaning that if I added “mysite” or “mysite.com” in my settings page, I cannot use “http://www.mysite.com” because neither of the 2 previous examples have “www.” in front of them.
So I’ve made sure the text matches completely. Great! Too bad it still fails. This next one took me a while to figure out. After a lot of digging around, and some trial and error, I discovered that it expects an extra “/” encoded at the end of the url.
They definitely need to add this crap to the documentation.