Did you know ... Search Documentation:
ax.pl -- Attribute Exchange library
PublicShow source

This library can be used to create HTTP request parameters and analyse form-data for attribute exchange. Attribute exchange (AX) is used by OpenID and OAuth to fetch attributes for accounts, such as the real username or e-mail address.

Source http_ax_attributes(+Spec, -HTTPAttributes) is det
True when HTTPAttributes is a list of Name=Value pairs that can be used with an HTTP request to query for the attributes Spec. Spec is a list of elements Alias(Value[, Options]). Options include:
required
The attribute is required. This is mutually exclusive with if_available.
if_available
Only provide the attribute if it is available. This is mutually exclusive with required. This is the default.
url(+URL)
Can be used to ovcerrule or extend the ax_alias/2.
count(+Count)
Maximum number of values to provide

For example:

?- http_ax_attributes([ nickname(Nick),
                        email(Email, [required])
                      ], Params).
Params = [ 'openid.ax.mode'          = fetch_request,
           'openid.ax.type.nickname' = 'http://axschema.org/namePerson/friendly',
           'openid.ax.type.email'    = 'http://axschema.org/contact/email',
           'openid.ax.required'      = email,
           'openid.ax.if_available'  = nickname
         ].
Source ax_alias(?Alias, ?URL) is nondet[multifile]
True when Alias is an alias name for the AX schema URL. This predicate is defined as multifile.

Note that Google federated login only supports email, country, language, firstname and lastname.

Source ax_form_attributes(+Form, -Values) is det
True if Values is a list Alias(Value) for each exchanged attribute.

Note that we assume we get the same alias names as we used for requesting the data. Not sure whether this is true.

Arguments:
Form- is an HTTP form as returned using the form(Form) option of http_parameters/3.