Require explicitly setting access_token value.
Silently substituting the password field was nice, but for mechs that can use either the password or an access token, it makes things very difficult. This really only affects MSN clients since Facebook clients should already be setting the api key.
This commit is contained in:
parent
bb0a5186d6
commit
f81fb6af44
1 changed files with 7 additions and 8 deletions
|
@ -36,18 +36,17 @@ class feature_mechanisms(base_plugin):
|
||||||
return 'starttls' in self.xmpp.features
|
return 'starttls' in self.xmpp.features
|
||||||
|
|
||||||
def basic_callback(mech, values):
|
def basic_callback(mech, values):
|
||||||
|
creds = self.xmpp.credentials
|
||||||
for value in values:
|
for value in values:
|
||||||
if value == 'username':
|
if value == 'username':
|
||||||
values['username'] = self.xmpp.boundjid.user
|
values['username'] = self.xmpp.boundjid.user
|
||||||
elif value == 'password':
|
elif value == 'password':
|
||||||
values['password'] = self.xmpp.credentials['password']
|
values['password'] = creds['password']
|
||||||
elif value == 'access_token':
|
elif value == 'email':
|
||||||
if 'access_token' in self.xmpp.credentials:
|
jid = self.xmpp.boundjid.bare
|
||||||
values['access_token'] = self.xmpp.credentials['access_token']
|
values['email'] = creds.get('email', jid)
|
||||||
else:
|
elif value in creds:
|
||||||
values['access_token'] = self.xmpp.credentials['password']
|
values[value] = creds[value]
|
||||||
elif value in self.xmpp.credentials:
|
|
||||||
values[value] = self.xmpp.credentials[value]
|
|
||||||
mech.fulfill(values)
|
mech.fulfill(values)
|
||||||
|
|
||||||
sasl_callback = self.config.get('sasl_callback', None)
|
sasl_callback = self.config.get('sasl_callback', None)
|
||||||
|
|
Loading…
Reference in a new issue