Add support for Google's X-OAUTH2 SASL mechanism
This commit is contained in:
parent
26fa9bd87e
commit
f65eb5eeea
1 changed files with 11 additions and 0 deletions
|
@ -123,6 +123,17 @@ class X_MESSENGER_OAUTH2(Mech):
|
||||||
return self.credentials['access_token']
|
return self.credentials['access_token']
|
||||||
|
|
||||||
|
|
||||||
|
@sasl_mech(10)
|
||||||
|
class X_OAUTH2(Mech):
|
||||||
|
|
||||||
|
name = 'X-OAUTH2'
|
||||||
|
required_credentials = set(['username', 'access_token'])
|
||||||
|
|
||||||
|
def process(self, challenge=b''):
|
||||||
|
return b'\x00' + self.credentials['username'] + \
|
||||||
|
b'\x00' + self.credentials['access_token']
|
||||||
|
|
||||||
|
|
||||||
@sasl_mech(3)
|
@sasl_mech(3)
|
||||||
class X_GOOGLE_TOKEN(Mech):
|
class X_GOOGLE_TOKEN(Mech):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue