Working with the WebFinger protocol is actually very easy. You simply make a series of cURL requests to a provider that implements WebFinger, which subsequently returns all of the information we need, as shown in Figure 10-4.
Figure 10-4. How WebFinger works
When a web application or service makes a request to a web source that uses WebFinger in order to obtain user information from that site, the web source will return either user record details or error information in the event that no user data was located.
As an example, let’s take a look at extracting profile information using Google’s WebFinger implementation. First, we will make a request to the /.well-known/host-meta file on Google to obtain more data about how Google’s WebFinger implementation works to extract profile information based on users’ email addresses. From a command prompt, we enter the following:
The response that is returned will contain data about the URI template format that Google uses to obtain the user’s profile from her email address:
<?xml version='1.0' encoding='UTF-8'?> <!-- NOTE: this host-meta end-point is a pre-alpha work in progress. Don't rely on it. ...