From 25a63c6ed15218881a87d75d4e97822c0613412b Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 22 Jul 2015 12:24:18 +0200 Subject: [PATCH] Use auth_password_format to determine plain or SCRAM is used --- ejabberd_auth_http/README.md | 8 ++++---- ejabberd_auth_http/src/ejabberd_auth_http.erl | 9 +++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ejabberd_auth_http/README.md b/ejabberd_auth_http/README.md index dc959a0..24ba32f 100644 --- a/ejabberd_auth_http/README.md +++ b/ejabberd_auth_http/README.md @@ -171,23 +171,23 @@ configuration along with use cases. An Auth token is provided as a password. * **Service implements:** `check_password`, `user_exists` -* **ejabberd config:** `password format`: `plain`, `mod_register` disabled +* **ejabberd config:** `auth_password format`: `plain`, `mod_register` disabled * **Client side:** MUST NOT use `DIGEST-MD5` mechanism; use `PLAIN` ### Central database of plaintext passwords * **Service implements:** `check_password`, `get_password`, `user_exists` -* **ejabberd config:** `password format`: `plain`, `mod_register` disabled +* **ejabberd config:** `auth_password_format`: `plain`, `mod_register` disabled * **Client side:** May use any available auth method ### Central database able to process SCRAM * **Service implements:** `get_password`, `user_exists` -* **ejabberd config:** `password format`: `scram`, `mod_register` disabled +* **ejabberd config:** `auth_password_format`: `scram`, `mod_register` disabled * **Client side:** May use any available auth method ### All-included * **Service implements:** all methods -* **ejabberd config:** `password format`: `scram` (recommended) or `plain`, `mod_register` enabled +* **ejabberd config:** `auth_password_format`: `scram` (recommended) or `plain`, `mod_register` enabled * **Client side:** May use any available auth method diff --git a/ejabberd_auth_http/src/ejabberd_auth_http.erl b/ejabberd_auth_http/src/ejabberd_auth_http.erl index d132b2f..7828166 100644 --- a/ejabberd_auth_http/src/ejabberd_auth_http.erl +++ b/ejabberd_auth_http/src/ejabberd_auth_http.erl @@ -65,12 +65,9 @@ start(Host) -> plain_password_required() -> false. --spec store_type(binary()) -> plain | scram. -store_type(Server) -> - case scram2:enabled(Server) of - false -> plain; - true -> scram - end. +-spec store_type() -> plain | scram. +store_type() -> + ejabberd_auth_odbc:store_type(). -spec check_password(ejabberd:luser(), ejabberd:lserver(), binary()) -> boolean(). check_password(LUser, LServer, Password) ->