Commit Graph

65 Commits

Author SHA1 Message Date
Pablo Polvorin 4332dddbc4 Support oauth password grant type
As in https://tools.ietf.org/html/rfc6749#section-4.3
2016-07-22 19:17:12 -03:00
Pablo Polvorin caf7b54305 oauth: single jid field instead of username/password fields 2016-07-22 15:37:48 -03:00
Pablo Polvorin cbfab687e8 Oauth callback must pass expires_in as ttl instead of epoch 2016-07-20 14:47:11 -03:00
Pablo Polvorin 1d317e8068 Let user choose the desired oauth token TTL 2016-07-19 20:18:07 -03:00
Pablo Polvorin 483ef09263 Fix command argument formatting 2016-07-19 00:51:04 -03:00
Pablo Polvorin 33e0283f0d Add 'ejabberd:user' and 'ejabberd:admin' oauth scopes
'ejabberd:user' includes all commands defined with policy "user".
'ejabberd:admin' includes commands defined with policy "admin".
2016-07-19 00:24:06 -03:00
Pablo Polvorin 673a654c47 Fix ce0d1704c6
Original request was to allow ejabberd sysadmin to generate
tokens for specific users.  JIDs must not be passed as argument
when requesting the tokens.
2016-07-18 20:25:23 -03:00
Pablo Polvorin ce0d1704c6 Allow generation of oauth tokens from command line
Oauth tokens can be generated for commands (scopes) having admin|user|open
policy. Restricted commands are not available as those are only usable
from ejabberdctl command line.

Four new commands are available:

$ejabberdctl oauth_issue_token "stats;get_roster"
    Generates a token authorized to call both stats and get_roster
    commands.  Note scopes must be separated by semicolon.

$ejabberdctl oauth_list_tokens
    List tokens generated from the command line, with their scope
    and expirity time.

$ejabberdctl oauth_list_scopes
    List scopes available

$ejabberdctl oauth_revoke_token "Lbs7qdJfdKXOWzVrArgyckY055tE1xnt"
    Revokes the given token
2016-06-29 00:22:28 -03:00
Paweł Chmielowski 3a8da27d86 Use {access,shaper}_rules_validator in other places where access rules are used 2016-06-21 13:18:24 +02:00
Evgeniy Khramtsov 46568fb959 Merge commit 'refs/pull/524/head' of github.com:processone/ejabberd into sasl-api-change 2016-03-25 18:16:50 +03:00
Mickael Remond 0b1620a45c Remove compile warnings 2016-02-08 10:50:28 +01:00
Badlop f448ff608a Update copyright to 2016 (#901) 2016-01-13 12:29:14 +01:00
Evgeniy Khramtsov 95265dd3ad Move JID related functions to jid.erl (#847) 2015-11-24 18:44:13 +03:00
Alexey Shchepin 88a206400a Add oauth_access option 2015-09-25 19:48:53 +03:00
Christophe Romain a1129dc96b Add OAuth support (thanks to Aleksey) 2015-09-25 15:49:07 +02:00