Fork me on GitHub

OpenID Attribute Exchange Support

The simplest manner of retrieving attributes is to first set up a CustomLoginPage (do that first, then keep reading). In this example, I’ll be fetching an email address from Google when a user authenticates. First, the custom login page:

<h1>This is my super cool personalized login page</h1>
<form action="/supersecret" method="GET">
  <input type="text" name="openid_identifier" />
  <input type="hidden" name="openid.ns.ext1" value="" />
  <input type="hidden" name="openid.ext1.mode" value="fetch_request" />
  <input type="hidden" name="" value="" />
  <input type="hidden" name="openid.ext1.required" value="email" />
  <input type="submit" value="Log In" />

When the user puts in their Google identity ( for everyone) they will see their email address being requested. After authentication and redirection, the openid.ext1 parameters will be kept and the query parameter will contain the value of the user’s email address.