|
@@ -1,13 +1,17 @@
|
1
|
1
|
#-*- coding: utf-8 -*-
|
2
|
2
|
|
3
|
3
|
from Lodel.user import authentication_method, identification_method, UserIdentity
|
|
4
|
+from Lodel import logger
|
4
|
5
|
|
5
|
6
|
@authentication_method
|
6
|
7
|
def dummy_auth(identifier, proof):
|
7
|
|
- print("Trying to authenticate user %s" % identifier)
|
|
8
|
+ logger.info("User '%s' is trying to authenticate" % identifier)
|
8
|
9
|
if identifier == proof:
|
9
|
10
|
print("%s authenticated" % identifier)
|
10
|
11
|
return UserIdentity(identifier, identifier, "User %s" % identifier, authenticated = True)
|
|
12
|
+ else:
|
|
13
|
+ logger.security("Authentication failed for user '%s'" % identifier)
|
|
14
|
+
|
11
|
15
|
return False
|
12
|
16
|
|
13
|
17
|
@identification_method
|