Add support for X-OAuth2 authentication in Jabber protocol

Review Request #129239 - Created Oct. 21, 2016 and submitted

Information
Pali Rohár
kopete
jabber-xoauth2
354473
Reviewers
kopete
Add support for X-OAuth2 authentication in Jabber protocol

Based on Psi demo code from:
https://github.com/psi-im/iris/issues/35
https://github.com/psi-plus/main/blob/master/patches/dev/xoauth2-support-demo.diff

REVIEW: 129239
BUG: 354473
FIXED-IN: 16.12
Tested with Google's XMPP server and authentication is working.

Google's configuration is quite complicated, so here are test steps:
1) Register project on https://console.developers.google.com/project and choose it
2) In "API Manager" choose "Credentials"
3) Setup "OAuth consent screen"
4) Go to "Create credentials" and select "OAuth client ID" and choose "Other" Application type
5) This will generate public "Client ID" and private "Client Secret Key" (keep it secret, no disclose!)
6) Clone project https://github.com/google/gmail-oauth2-tools which has "oauth2.py" script
7) Run: python python/oauth2.py --generate_oauth2_token --client_id="Client ID" --client_secret="Client Secret Key" --scope=https://www.googleapis.com/auth/googletalk
8) Open URL webpage generated by script, copy verification code from webpage and type it into oauth2.py script
9) After that oauth2.py script will provide private "Refresh Token" (keep it secret, no disclose!)
10) Go to Kopete Jabber Account Settings into Connection tab, check "Use X-OAuth2 authentication" and open "Manage X-OAuth2 tokens"
11) Type "Client ID", "Client Secret Key", "Refresh Token" and as "Request URL" use: "https://accounts.google.com/o/oauth2/token"

From "Client ID", "Client Secret Key", "Refresh Token" via "Request URL" is retrived "Access Token" which is then used for real authentication. You can use "Access Token" for autentication too (instead previous four settings), but Google generates "Access Token" with one hour validity.
Pali Rohár
Pali Rohár
Pali Rohár
Review request changed

Status: Closed (submitted)

Change Summary:

Committed: http://commits.kde.org/kopete/3bff188483fd2ee01bb8310a511e8cc9a4808d22
Loading...