ax.pl -- Attribute Exchange library
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.
- 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:
- The attribute is required. This is mutually exclusive
- Only provide the attribute if it is available. This is
mutually exclusive with
required. This is the default.
- Can be used to ovcerrule or extend the ax_alias/2.
- Maximum number of values to provide
?- 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 ].
- 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
- ax_form_attributes(+Form, -Values) is det
- True if Values is a list Alias(Value) for each exchanged
Note that we assume we get the same alias names as we used for requesting the data. Not sure whether this is true.