Adding hash support
This commit is contained in:
parent
cae29d263f
commit
586b804a05
@ -1,7 +1,7 @@
|
|||||||
from radicale.auth import BaseAuth
|
from radicale.auth import BaseAuth
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import json
|
import json
|
||||||
|
import hashlib
|
||||||
|
|
||||||
class Auth(BaseAuth):
|
class Auth(BaseAuth):
|
||||||
def generate_base_uri(self, endpoint):
|
def generate_base_uri(self, endpoint):
|
||||||
@ -14,7 +14,7 @@ class Auth(BaseAuth):
|
|||||||
if user is None:
|
if user is None:
|
||||||
return False
|
return False
|
||||||
main_uri = self.generate_base_uri(
|
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)
|
req = urllib.request.urlopen(main_uri, data=None)
|
||||||
jsons = req.read()
|
jsons = req.read()
|
||||||
data = json.loads(jsons)
|
data = json.loads(jsons)
|
||||||
|
Loading…
Reference in New Issue
Block a user