mmpy_bot: requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://chat.domain.org/api/v4/users/login

I don’t know if I’m doing anything wrong, but the same config that used to work with the main repo doesn’t work with the fork here. Here’s the settings I use with it

SSL_VERIFY = True  # Whether to perform SSL cert verification
BOT_URL = 'http://chat.domain.org/api/v4'  # with 'http://' and with '/api/v3' path. without trailing slash. '/api/v1' - for version < 3.0
BOT_LOGIN = 'botmail@domain.com'
BOT_PASSWORD = 'botpassword'
BOT_TEAM = 'botteam'  # possible in lowercase

Anything I could try? Thanks!

edit: This might not be related to your fork, but we’ve updated mattermost recently and I can’t really test master for this as it simply doesn’t support api/v4 I think.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 25 (19 by maintainers)

Most upvoted comments

PR with fix merged

Thanks @seLain it works now! If I get time today I’ll try to make a very minimal reproducible setup with docker with nginx and mattermost that you could test if you’re interested.

Glad to hear the fix works, I think it also makes sense for us to check for redirect and re-try. @seLain do you want to make a PR with all redirect status codes 301, 302, 307, any others?