1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 """External SASL authentication mechanism for PyXMPP SASL implementation.
18
19 Normative reference:
20 - `RFC 3920bis <http://xmpp.org/internet-drafts/draft-saintandre-rfc3920bis-08.html#security>`__
21 - `XEP-0178 <http://xmpp.org/extensions/xep-0178.html#c2s>__`
22 """
23
24 __docformat__="restructuredtext en"
25
26 import base64
27
28 import logging
29
30 from pyxmpp.sasl.core import (ClientAuthenticator,Failure,Response,Challenge,Success)
31
33 """Provides client-side External SASL (TLS-Identify) authentication."""
34
35
37 ClientAuthenticator.__init__(self, password_manager)
38 self.password_manager = password_manager
39 self.__logger = logging.getLogger("pyxmpp.sasl.external.ExternalClientAuthenticator")
40
41 - def start(self, username, authzid):
42 self.username = username
43 self.authzid = authzid
44
45
46
47
48 return Response(self.authzid, encode = True)
49
50
52 """Handle authentication success information from the server.
53
54 :Parameters:
55 - `data`: the optional additional data returned with the success.
56 :Types:
57 - `data`: `str`
58
59 :return: a success indicator.
60 :returntype: `Success`"""
61 _unused = data
62 return Success(self.username,None,self.authzid)
63
64
65