aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/oauth2.c5
-rw-r--r--protocols/jabber/sasl.c18
-rw-r--r--root_commands.c2
3 files changed, 13 insertions, 12 deletions
diff --git a/lib/oauth2.c b/lib/oauth2.c
index 0348d0d0..1af63974 100644
--- a/lib/oauth2.c
+++ b/lib/oauth2.c
@@ -116,8 +116,6 @@ static void oauth2_access_token_done( struct http_request *req )
{
atoken = oauth2_json_dumb_get( req->reply_body, "access_token" );
rtoken = oauth2_json_dumb_get( req->reply_body, "refresh_token" );
- if( getenv( "BITLBEE_DEBUG" ) )
- printf( "Extracted atoken=%s rtoken=%s\n", atoken, rtoken );
}
else
{
@@ -129,6 +127,9 @@ static void oauth2_access_token_done( struct http_request *req )
rtoken = g_strdup( oauth_params_get( &p_in, "refresh_token" ) );
oauth_params_free( &p_in );
}
+ if( getenv( "BITLBEE_DEBUG" ) )
+ printf( "Extracted atoken=%s rtoken=%s\n", atoken, rtoken );
+
cb_data->func( cb_data->data, atoken, rtoken );
g_free( atoken );
g_free( rtoken );
diff --git a/protocols/jabber/sasl.c b/protocols/jabber/sasl.c
index b4eb4eb8..d08890a6 100644
--- a/protocols/jabber/sasl.c
+++ b/protocols/jabber/sasl.c
@@ -104,10 +104,14 @@ xt_status sasl_pkt_mechanisms( struct xt_node *node, gpointer data )
c = c->next;
}
- if( !sup_plain && !sup_digest && !sup_gtalk && !sup_fb && !sup_ms )
+ if( !sup_plain && !sup_digest )
{
- imcb_error( ic, "BitlBee does not support any of the offered SASL "
- "authentication schemes:%s", mechs->str );
+ if( !sup_gtalk && !sup_fb && !sup_ms )
+ imcb_error( ic, "This server requires OAuth "
+ "(supported schemes:%s)", mechs->str );
+ else
+ imcb_error( ic, "BitlBee does not support any of the offered SASL "
+ "authentication schemes:%s", mechs->str );
imc_logout( ic, FALSE );
g_string_free( mechs, TRUE );
return XT_ABORT;
@@ -293,12 +297,8 @@ xt_status sasl_pkt_challenge( struct xt_node *node, gpointer data )
if( jd->flags & JFLAG_SASL_FB )
{
- /* Facebook proprietary authentication. Not as useful as it seemed, but
- the code's written now, may as well keep it..
-
- Mechanism is described on http://developers.facebook.com/docs/chat/
- and in their Python module. It's all mostly useless because the tokens
- expire after 24h. */
+ /* New-style Facebook OAauth2 support. Instead of sending a refresh
+ token, they just send an access token that should never expire. */
GSList *p_in = NULL, *p_out = NULL;
char time[33];
diff --git a/root_commands.c b/root_commands.c
index f8f2e578..fcf6f66e 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -458,7 +458,7 @@ static void cmd_account( irc_t *irc, char **cmd )
irc_rootmsg( irc, "You can now use the /OPER command to "
"enter the password" );
if( oauth )
- irc_rootmsg( irc, "Alternatively, enable oauth if "
+ irc_rootmsg( irc, "Alternatively, enable OAuth if "
"the account supports it: account %s "
"set oauth on", a->tag );
}