Adding hash support

This commit is contained in:
Fabian Stamm 2017-12-12 10:52:17 +01:00
parent cae29d263f
commit 586b804a05
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
from radicale.auth import BaseAuth
import urllib.request
import json
import hashlib
class Auth(BaseAuth):
def generate_base_uri(self, endpoint):
@ -14,7 +14,7 @@ class Auth(BaseAuth):
if user is None:
return False
main_uri = self.generate_base_uri(
"/client/check_pw") + "&uuid=" + user + "&password=" + password
"/client/check_pw") + "&hashed=true&uuid=" + user + "&password=" + hashlib.sha512(password.encode()).hexdigest()
req = urllib.request.urlopen(main_uri, data=None)
jsons = req.read()
data = json.loads(jsons)