[asterisk-bugs] [JIRA] (ASTERISK-27207) XMPP OAuth not working due to inverted logic

Friendly Automation (JIRA) noreply at issues.asterisk.org
Tue Aug 22 07:46:08 CDT 2017


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=238164#comment-238164 ] 

Friendly Automation commented on ASTERISK-27207:
------------------------------------------------

Change 6249 merged by Jenkins2:
res_xmpp: fix inverted return code check in OAuth

[https://gerrit.asterisk.org/6249|https://gerrit.asterisk.org/6249]

> XMPP OAuth not working due to inverted logic
> --------------------------------------------
>
>                 Key: ASTERISK-27207
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27207
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_xmpp
>    Affects Versions: 13.18.0
>         Environment: Debian Jessie amd64
>            Reporter: Michael Kuron
>            Assignee: Michael Kuron
>
> ASTERISK-27169 introduced OAuth support into res_xmpp. The change was cherry-picked into Asterisk 13 as commit 54e3ac402ff167ba2463b386ea25fa5327be86c6. Unfortunately, it seems like the cherry-picked code does not actually work , likely due to func_curl changes in Asterisk 14 and higher (probably commit 6bbcfb34bd411ec88a02e6c655b0d5b9821495a4). The token is correctly refreshed via func_curl, but the resulting XML is never copied to the read buffer. The error message displayed claims that "CURL is unavailable.", which is inaccurate -- CURL is available, only the XML is never passed back. The relevant log lines are shown below. I am currently trying to work up a patch to fix this in Asterisk 13.
> {code}
> DEBUG[22076]: res_xmpp.c:3826 xmpp_client_thread: [google] Connecting
> DEBUG[22076]: res_xmpp.c:3658 xmpp_client_reconnect: Obtaining OAuth access token for client 'google'
> DEBUG[22076]: res_xmpp.c:3918 fetch_access_token: Performing OAuth 2.0 authentication for client 'google' using command: CURL(https://www.googleapis.com/oauth2/v3/token,client_id=XXX&client_secret=YYY&refresh_token=ZZZ&grant_type=refresh_token)
> DEBUG[22076]: func_curl.c:534 WriteMemoryCallback: Called with data=0xb4e2da14, str=0xb6803a50, realsize=199, len=16, used=0
> DEBUG[22076]: func_curl.c:538 WriteMemoryCallback: Now, len=256, used=199
> DEBUG[22076]: func_curl.c:704 acf_curl_helper: str='{
>  "access_token": "AAA",
>  "token_type": "Bearer",
>  "expires_in": 3600
> }'
> ERROR[22076]: res_xmpp.c:3921 fetch_access_token: CURL is unavailable. This is required for OAuth 2.0 authentication of XMPP client 'google'. Please ensure it is loaded.
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list