Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mattermost login problem #1075

Closed
KlavsKlavsen opened this issue May 20, 2021 · 2 comments
Closed

mattermost login problem #1075

KlavsKlavsen opened this issue May 20, 2021 · 2 comments
Labels

Comments

@KlavsKlavsen
Copy link

KlavsKlavsen commented May 20, 2021

Login to mattermost returns 401 with this:

21-05-20 09:16:20 yetibot-ccb4c77f9-84dr7 WARN [yetibot.core.adapters:40] - Error on Mattermost clojure.lang.ExceptionInfo: clj-http: status 401
{:cached nil, :request-time 414, :repeatable? false, :protocol-version {:name "HTTP", :major 1, :minor 1}, :streaming? true, :http-client #object[org.apache.http.impl.client.InternalHttpClient 0x4eeb2668 "org.apache.http.impl.client.InternalHttpClient@4eeb2668"], :chunked? false, :type :clj-http.client/unexceptional-status, :reason-phrase "Unauthorized", :headers {"server" "nginx", "x-version-id" "5.33.3.5.33.3.3599d6d6f1c4bd6f610a9e289b7c6518.false", "content-type" "application/json", "content-length" "186", "connection" "close", "expires" "0", "date" "Thu, 20 May 2021 09:16:20 GMT", "vary" "Accept-Encoding", "x-request-id" "umdr89883tyofyx4sskqj5jdhe"}, :orig-content-encoding nil, :status 401, :length 186, :body "{\"id\":\"api.context.session_expired.app_error\",\"message\":\"Invalid or expired session, please login again.\",\"detailed_error\":\"\",\"request_id\":\"umdr89883tyofyx4sskqj5jdhe\",\"status_code\":401}", :trace-redirects []}

A clear and concise description of what the bug is.
The token is generated under "BOT" accounts and I've verified YETIBOT_ADAPTERS_MYMATTERMOST_TOKEN in env output in pod has the correct value.

I don't see anywhere to define what the username - for which this token is valid is defined? Or does this adapter not work with bot accounts ?

@devth
Copy link
Member

devth commented May 23, 2021

I'm using a mattermost bot account on a server I provisioned using the Heroku deploy button in the docs.

You're welcome to test on it if you'd like. I can set up a bot account for you. Config doesn't require a username - just a token.

My bot under Main menu -> Integrations -> Bot accounts looks like this:

image

My local adapter config looks like:

   :yetibot-adapters-ybmattermost-type "mattermost"
   :yetibot-adapters-ybmattermost-host "yetibot-mattermost.herokuapp.com"
   :yetibot-adapters-ybmattermost-token "asdfaasdfasdfasdfasdfasdfa"
   :yetibot-adapters-ybmattermost-secure "true" ;; true by default

@devth
Copy link
Member

devth commented Apr 19, 2023

Let me know if you're still having trouble!

@devth devth closed this as completed Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants