diff options
author | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-07-18 22:31:08 +0300 |
---|---|---|
committer | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-07-18 22:31:08 +0300 |
commit | 6d6e3e348de18bb0b51a82ccf3715fb4c823e9a6 (patch) | |
tree | 6f5761fe8ad0bfb4d61e3adf6d5dd7687f19d742 /src/ejabberd_auth_jwt.erl | |
parent | Get rid of useless code (diff) |
Improve robustness of reading jwt_key option
Diffstat (limited to 'src/ejabberd_auth_jwt.erl')
-rw-r--r-- | src/ejabberd_auth_jwt.erl | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/ejabberd_auth_jwt.erl b/src/ejabberd_auth_jwt.erl index 7b14835d..4d52b11d 100644 --- a/src/ejabberd_auth_jwt.erl +++ b/src/ejabberd_auth_jwt.erl @@ -64,7 +64,7 @@ check_password(User, AuthzId, Server, Token) -> %%% Internal functions %%%---------------------------------------------------------------------- check_jwt_token(User, Server, Token) -> - JWK = get_jwk(Server), + JWK = ejabberd_option:jwt_key(Server), try jose_jwt:verify(JWK, Token) of {true, {jose_jwt, Fields}, Signature} -> ?DEBUG("jwt verify: ~p - ~p~n", [Fields, Signature]), @@ -100,9 +100,6 @@ check_jwt_token(User, Server, Token) -> false end. -get_jwk(Host) -> - jose_jwk:from_binary(ejabberd_option:jwt_key(Host)). - %% TODO: auth0 username is defined in 'jid' field, but we should %% allow customizing the name of the field containing the username %% to adapt to custom claims. |