yokomizor / ejabberd-auth-jwt

:speech_balloon: Ejabberd authentication module using JWT tokens
Apache License 2.0
5 stars 2 forks source link

Unknown option 'jwtauth_key' #4

Closed binhrobin closed 6 years ago

binhrobin commented 6 years ago

Hi, After install this module to ejabberd server. I start and see this log although i added this option in ejabberd.yml

hosts:

loglevel: 5 log_rotate_size: 10485760 log_rotate_date: "" log_rotate_count: 1 log_rate_limit: 100

jwtauth_key: "" jwtauth_pem_file: "" jwtauth_user_claim: "sub" jwtauth_strict_alg: "HS256"

Loading configuration from /Users/lv/ejabberd/etc/ejabberd/ejabberd.yml 18:00:31.419 [error] Unknown option 'jwtauth_key' 18:00:31.419 [error] Failed to load configuration file /Users/lv/ejabberd/etc/ejabberd/ejabberd.yml 18:00:31.419 [critical] Failed to start ejabberd application: unknown_option

yokomizor commented 6 years ago

Hi,

Since 18.06, Ejabberd won't start with unknown options: https://blog.process-one.net/ejabberd-18-06/

Stop ejabberd initialization on invalid/unknown options Since some time now, we are warning ejabberd admins in log file about incorrect configuration options. We feel that we are ready to make these hints strong requirements about config file validity.

Starting with ejabberd 18.06, ejabberd will not ignore unknown options and doesn’t allow to have options with malformed values. The rationale for this is to avoid unexpected behaviour during runtime, i.e. to conform to “fail early” approach. We thus hope to be helpful to newcomers by making sure they properly format their config files to get the expected behaviour.

Note that it’s safe to reload a configuration with potentially invalid and/or unknown options: this will not halt ejabberd, but will only prevent the configuration from loading.

Auth modules do not use gen_mod behaviour, and for this reason, new ejabberd versions don't know how to configure them. I don't know how to solve this issue yet. I will wait until they fix ejabberd_auth_http, then I will use the same strategy.

https://github.com/processone/ejabberd-contrib/issues/262

yokomizor commented 6 years ago

Changing from ejabberd_config to gen_mod behaviour seems to fix the problem:

https://github.com/yokomizor/ejabberd-auth-jwt/commit/e80a3ae300a68c4f288685efc60a7864b20d0f32