OpenID Explained← Return to the front page

Are you a developer thinking about using OpenID?

Disclaimer

This page contains recommendations and tips for developers who have already implemented OpenID consumers and/or producers. If you want help building one for the first time, it depends largely on which language you choose and which library. Here is a list of libraries.

Table of contents

  1. Tips for OpenID consumers
  2. Linking to us
  3. Using our form
  4. Tips for OpenID providers

Tips for OpenID consumers

Linking to us

To make life easier on your users, we will supply a link back to your login page. To do this, we give you the option of sending us the following variables (via GET) :

You can also include these in a shorter form as:

All other variables you send to us (via GET) will get sent back identically when the user returns. So, if a user has started filling out your form and then clicked a link to OpenIDExplained.com, you can send us the information they've already filled out, and when the user returns to your website, we'll send it back to you (to auto-fill the fields they've already worked on). (Note: please don't send us any unencrypted data for obvious privacy reasons.)

In addition, if the user has filled out our form on the "How Do I Get an OpenID?" page, we'll send that to you as well with the GET variable:

OID_consumer_user

Using our form

If you like the form on the "How Do I Get an OpenID?" page, we welcome you to use it as a tool for new OpenID users to get acquainted with the system (this is not meant as a replacement for the regular OpenID field, just a way to ease people into OpenID).

We have a page that accesses our Database and returns XML, JSON, or Text depending on your preference. It is located at:

http://www.openidexplained.com/get_provider

It can handle two types of queries:

  1. to get an OpenID for a given username and provider
  2. to get a list of popular OpenID providers and a schema for getting a user's OpenID for each

Query (1) expects (via GET) :

Query (1) will return:

x refers to the user's OpenID

For XML
<url>x</url>
For JSON
{ "url": "x" }
For text
x

Query (2) expects (via GET) :

Query (2) will return:

p1,p2,p3,... refer to provider names

u1,u2,u3,... refer to URL schema (see below)

XML
<providers>
	<provider>
		<domain>p1</domain>
		<url>u1</url>
	</provider>
	<provider>
		<domain>p2</domain>
		<url>u2</url>
	</provider>
	...
</providers> 
JSON
{"providers":
	{"provider": [
		{"domain": "p1","url": "u1"},
		{"domain": "p2","url": "p2"},
		...
	]}
} 
text
p1,u1,p2,u2,...

URL Schema

A URL Schema looks exactly like a valid OpenID, except that it has the string %s where the username should go. So, the schema for LiveJournal is %s.livejournal.com. Once you get the user's username, you replace %s with it, and you have her or his OpenID.

Tips for OpenID providers