summaryrefslogtreecommitdiff
path: root/modules/openid/openid.api.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/openid/openid.api.php')
-rw-r--r--modules/openid/openid.api.php60
1 files changed, 60 insertions, 0 deletions
diff --git a/modules/openid/openid.api.php b/modules/openid/openid.api.php
index 2144945ee..d71638b45 100644
--- a/modules/openid/openid.api.php
+++ b/modules/openid/openid.api.php
@@ -47,5 +47,65 @@ function hook_openid_response($response, $account) {
}
/**
+ * Allow modules to declare OpenID discovery methods.
+ *
+ * The discovery function callbacks will be called in turn with an unique
+ * parameter, the claimed identifier. They have to return an array of services,
+ * in the same form returned by openid_discover().
+ *
+ * The first discovery method that succeed (return at least one services) will
+ * stop the discovery process.
+ *
+ * @return
+ * An associative array which keys are the name of the discovery methods and
+ * values are function callbacks.
+ * @see hook_openid_discovery_method_info_alter()
+ */
+function hook_openid_discovery_method_info() {
+ return array(
+ 'new_discovery_idea' => '_my_discovery_method',
+ );
+}
+
+/**
+ * Allow modules to alter discovery methods.
+ */
+function hook_openid_discovery_method_info_alter(&$methods) {
+ // Remove Google discovery scheme.
+ unset($methods['google']);
+}
+
+/**
+ * Allow modules to declare OpenID normalization methods.
+ *
+ * The discovery function callbacks will be called in turn with an unique
+ * parameter, the identifier to normalize. They have to return a normalized
+ * identifier, or NULL if the identifier is not in a form they can handle.
+ *
+ * The first normalization method that succeed (return a value that is not NULL)
+ * will stop the normalization process.
+ *
+ * @return
+ * An array with a set of function callbacks, that will be called in turn
+ * when normalizing an OpenID identifier. The normalization functions have
+ * to return a normalized identifier, or NULL if the identifier is not in
+ * a form they can handle.
+ * @see hook_openid_normalization_method_info_alter()
+ */
+function hook_openid_normalization_method_info() {
+ return array(
+ 'new_normalization_idea' => '_my_normalization_method',
+ );
+}
+
+/**
+ * Allow modules to alter normalization methods.
+ */
+function hook_openid_normalization_method_info_alter(&$methods) {
+ // Remove Google IDP normalization.
+ unset($methods['google_idp']);
+}
+
+/**
* @} End of "addtogroup hooks".
*/