diff options
author | dequis <dx@dxzone.com.ar> | 2017-10-16 22:11:42 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2017-10-16 22:11:42 -0300 |
commit | 24db488909604dd389b584c1f1ce43c549648dbe (patch) | |
tree | cd5bb0df1a81a8ed370540c800eb13bbb5051f3a /facebook/facebook-util.h | |
parent | 1e264442a48f33a5933c49a2c0332e426dcdb4a1 (diff) | |
download | bitlbee-facebook-24db488909604dd389b584c1f1ce43c549648dbe.tar.gz bitlbee-facebook-24db488909604dd389b584c1f1ce43c549648dbe.tar.bz2 bitlbee-facebook-24db488909604dd389b584c1f1ce43c549648dbe.tar.xz |
Work chat login support (enable the "work" setting to use it)
This covers three autodetected login types:
1. Work account password
Simple, very similar to normal account types
2. Linked personal account
This is deprecated but still needed in some companies. Looks just
like password auth to users. In rare cases there may be more than
one work account linked to a personal account, in which case this
will only use the first one. Usually they can be de-linked by
assigning a password (see the official docs)
3. SSO
This one is awkward. The password can be set to garbage and users
will receive a PM with instructions to do an oauth-like login,
but there's no explicit auth code screen, just a redirect to a
fb-workchat-sso://, which probably results in an error. Users are
expected to copy that url, hopefully from the address bar.
Not very practical, but works!
In all cases, the username is the work account email.
Diffstat (limited to 'facebook/facebook-util.h')
-rw-r--r-- | facebook/facebook-util.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/facebook/facebook-util.h b/facebook/facebook-util.h index a595cf3..b080eb4 100644 --- a/facebook/facebook-util.h +++ b/facebook/facebook-util.h @@ -289,4 +289,30 @@ fb_util_zlib_deflate(const GByteArray *bytes, GError **error); GByteArray * fb_util_zlib_inflate(const GByteArray *bytes, GError **error); +/** + * fb_util_urlsafe_base64_encode: + * @data: the binary data to encode. + * @len: the length of data + * + * Wrapper around g_base64_encode() which substitutes '-' instead of '+' + * and '_' instead of '/' and removes the padding + * + * Returns: A newly allocated string. + */ + +gchar * +fb_util_urlsafe_base64_encode(const guchar *data, gsize len); + +/** + * fb_util_gen_sso_verifier: + * @challenge: base64 of sha256 of verifier + * @verifier: base64 of random data + * @req_id: base64 of random data + * + * Generates the challenge/response parameters used for the workchat SSO auth. + * All parameters are output parameters. + */ +void +fb_util_gen_sso_verifier(gchar **challenge, gchar **verifier, gchar **req_id); + #endif /* _FACEBOOK_UTIL_H_ */ |