mattermost / mattermost-plugin-gitlab

GitLab plugin for Mattermost
Apache License 2.0
141 stars 85 forks source link

Gitlab Oauth setup issue via Chat #439

Closed DatadudeDev closed 10 months ago

DatadudeDev commented 10 months ago

Installed the plugin and attempted to setup oauth via the chatbot (slash commands):

/gitlab setup oauth

I followed the prompts for creating an application. The prompts are slightly outdated (no longer a token expiry option).

Arrived at the section to enter the clientID and secretkey.

#########################################################################################

Expected behaviour:

The clietnID and secretKey are accepted and oauth works without issue.

#########################################################################################

Actual behavior:

The secretkey is not accepted, citing 64 max characters while the gitlab secretkey is 70 characters (because of the "gloas-" pewfix.

The chatbot wil not accept the secretkey unless the prefix is trimmed, but then oauth fails with the following error:

Failed to exchange oauth code into token: oauth2: cannot fetch token: 401 Unauthorized
Response: {"error":"invalid_client","error_description":"Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method."}

#########################################################################################

Temporary fix:

Enter your oauth credentials directly into the plugin config via system console. The input field allows the entire secretkey, including the prefix.

mickmister commented 10 months ago

Hi @DatadudeDev, thanks for filing this issue. This issue is fixed via https://github.com/mattermost/mattermost-plugin-gitlab/pull/419, but has not been released yet. I think this issue warrants its own patch release so we will have this available soon

mickmister commented 10 months ago

Enter your oauth credentials directly into the plugin config via system console. The input field allows the entire secretkey, including the prefix.

It seems this has been solved on your end. I'll go ahead and close this for now. Let me know if you have any questions. Note that we are in the process of releasing the fix as mentioned above.

Thanks @DatadudeDev!

DatadudeDev commented 7 months ago

thanks folks!