5 * Hooks provided by the OpenID module.
14 * Allow modules to modify the OpenID request parameters.
17 * The operation to be performed.
19 * - request: Modify parameters before they are sent to the OpenID provider.
21 * An associative array of parameter defaults to which to modify or append.
23 * An associative array of parameters to be merged with the default list.
26 function hook_openid($op, $request) {
27 if ($op == 'request') {
28 $request['openid.identity'] = 'http://myname.myopenid.com/';
34 * Allow modules to act upon a successful OpenID login.
37 * Response values from the OpenID Provider.
39 * The Drupal user account that logged in
42 function hook_openid_response($response, $account) {
43 if (isset($response['openid.ns.ax'])) {
44 _mymodule_store_ax_fields($response, $account);
49 * Allow modules to declare OpenID discovery methods.
51 * The discovery function callbacks will be called in turn with an unique
52 * parameter, the claimed identifier. They have to return an associative array
53 * with array of services and claimed identifier in the same form as returned by
54 * openid_discover(). The resulting array must contain following keys:
55 * - 'services' (required) an array of discovered services (including OpenID
56 * version, endpoint URI, etc).
57 * - 'claimed_id' (optional) new claimed identifer, found by following HTTP
58 * redirects during the services discovery.
60 * The first discovery method that succeed (return at least one services) will
61 * stop the discovery process.
64 * An associative array which keys are the name of the discovery methods and
65 * values are function callbacks.
67 * @see hook_openid_discovery_method_info_alter()
69 function hook_openid_discovery_method_info() {
71 'new_discovery_idea' => '_my_discovery_method',
76 * Allow modules to alter discovery methods.
78 function hook_openid_discovery_method_info_alter(&$methods) {
79 // Remove XRI discovery scheme.
80 unset($methods['xri']);
84 * Allow modules to declare OpenID normalization methods.
86 * The discovery function callbacks will be called in turn with an unique
87 * parameter, the identifier to normalize. They have to return a normalized
88 * identifier, or NULL if the identifier is not in a form they can handle.
90 * The first normalization method that succeed (return a value that is not NULL)
91 * will stop the normalization process.
94 * An array with a set of function callbacks, that will be called in turn
95 * when normalizing an OpenID identifier. The normalization functions have
96 * to return a normalized identifier, or NULL if the identifier is not in
97 * a form they can handle.
98 * @see hook_openid_normalization_method_info_alter()
100 function hook_openid_normalization_method_info() {
102 'new_normalization_idea' => '_my_normalization_method',
107 * Allow modules to alter normalization methods.
109 function hook_openid_normalization_method_info_alter(&$methods) {
110 // Remove Google IDP normalization.
111 unset($methods['google_idp']);
115 * @} End of "addtogroup hooks".