Topic: mlmmadmin API token errors
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0
- Deployed with iRedMail Easy or the downloadable installer?: neither, manual
- Linux/BSD distribution name and version: FreeBSD 11.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL 8.0.19
- Web server (Apache or Nginx): Nginx 1.16
- Manage mail accounts with iRedAdmin-Pro? Yes, IredAdmin-Pro 4.2
====
Both mlmmjadmin and iredadmin(-pro) need a token in order to function properly (and communicate with each other).
I am experiencing errors in the IredAdmin-Pro interface in one particular circumstance, and one only:
- when trying to edit existing users
The API token is configured in mlmmjadmin and iredadmin settings.py configuration files:
/opt/mlmmjadmin -> api_auth_tokens = '43a89b7aatokenhash'
/opt/www/iredadmin -> mlmmjadmin_api_auth_token = '43a89b7aatokenhash'
The formatting of the token is very particular. In the above example the application interface returns, when trying to edit existing mail users.
Error: InvalidHeader("Value for header {X-MLMMJADMIN-API-AUTH-TOKEN: ['43a89b7aatokenhash']} must be of type str or bytes, not <type 'list'>",)
When I change the format string to:
/opt/mlmmjadmin -> api_auth_tokens = ['43a89b7aatokenhash']
/opt/www/iredadmin -> mlmmjadmin_api_auth_token = ['43a89b7aatokenhash']
the same error appears
Error: InvalidHeader("Value for header {X-MLMMJADMIN-API-AUTH-TOKEN: ['43a89b7aatokenhash']} must be of type str or bytes, not <type 'list'>",)
Which is odd, because ['43a89b7aatokenhash'] is the prescribed format
When I change the format string to:
/opt/mlmmjadmin -> api_auth_tokens = ['43a89b7aatokenhash']
/opt/www/iredadmin -> mlmmjadmin_api_auth_token = '43a89b7aatokenhash'
The following error occurs:
Error: JSONDecodeError('Expecting value: line 1 column 1 (char 0)',)
When I change the format string to:
/opt/mlmmjadmin -> api_auth_tokens = '43a89b7aatokenhash'
/opt/www/iredadmin -> mlmmjadmin_api_auth_token = ['43a89b7aatokenhash']
The old error returns:
Error: InvalidHeader("Value for header {X-MLMMJADMIN-API-AUTH-TOKEN: ['43a89b7aatokenhash']} must be of type str or bytes, not <type 'list'>",)
In any case none of these variations gives me the desired result: the ability to edit mail user accounts
please advise.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.