At the request of a reader, I’ve updated Simple OpenID by adding support for Google’s OpenID implementation for Gmail users, as well as some other changes. Download the latest version here.
After a couple months, Google is finally publishing its XRDS document (like Yahoo does) from www.gmail.com. So what I’ve done is add a line that checks for “google” or “gmail” in the user’s OpenID, and if found, standardizes the input as “http://gmail.com”, at which point we can use Yadis to discover the server location. I implemented it this way because I figure users might be confused whether their provider URL is “http://google.com” or “http://gmail.com”. As an added bonus, it also allows people to enter “username@gmail.com” and it will still work. I don’t know of any clear guidelines on this, so if anyone knows of a better way to implement it, please let me know.
This brings us to Attribute Exchange (AX) and Simple Registration (SREG) info. Simple OpenID now supports both. Just use the SetRequiredFields and SetOptionalFields methods as before. Some OpenID providers use AX info, some use SREG, and some ignore both. Google, for example, will only return the user’s email address, and only if you specify it as a required field.
Other changes: I’ve added the ability to set PAPE auth policies and a time limit on authentication (max_auth_age). I haven’t tested these to see if they work though. If you’re interested, try it out and let me know the results. I commented out the section that deals with standardizing XRI strings after I noticed it’s only half implemented. I’ll work on both of these parts as time permits.
Tags: attribute exchange, google, openid, php, tutorial
Subscribe to the feed
Subscribe by email