[SOLVED] Parameters for OAuth client

We want to use mattermost authentication for kanboard.GitHub - kanboard/plugin-oauth2: Generic OAuth2 authentication plugin
We need answers to what links and keys we need to configure. The fields we need are:

Callback URL: https://kanban.myhost.net/oauth/callback
Client ID: ••••••••••••••••••••••••••
Client Secret:••••••••••••••••••••••••••
Authorize URL:https://chat.myhost.net/oauth/authorize
Token URL:https://chat.myhost.net/oauth/token
User API URL:https://chat.myhost.net/api/v3/user

Scopes
Username Key
Name Key
Email Key
User ID Key

Allow Account Creation: checked
Allow account creation only for those domains

Mattermost OAuth2 App Config
kanboard
kanboard.myhost.net
Is Trusted: Yes
Client ID: **********************
Client Secret: ***************
Callback URLs: https://kanban.myhost.net/oauth/callback
Created by jimscarver on Thursday, September 28, 2017

Hi @jimscarver,

Thanks for your feedback,

This documentation might be of assistance for your setup?

Thanks. I followed those instructions but did not find any instruction on the values to use for the username key, name key, email key, or user id key.

In https://kanboard.net/plugin/oauth2 the examples have different values for different systems but does not say what values to use for mattermost.

Example for Github OAuth2:
Username Key: login
Name Key: name
Email Key: email
User ID Key: id

Example for Salesforce:
Username Key: nickname
Name Key: name
Email Key: email
User ID Key: user_id

I am currently using the values

Scopes: login
Username Key: user_id
Name Key: name
Email Key: email
User ID Key: user_id

And getting an error in the login screen returned.
“The OAuth2 state parameter is invalid”

I assume I guessed wrong one or more of the parameters.

Thanks @jimscarver,

I’ll ask the team to weigh in to see if they can help troubleshoot your issue further…

We seem to be authenticating on the mattermost side with the values we chose but fail on the kanboard side.
The state error was my mistake, a red herring.

I still have not found the correct parameter mapping to configure for mattermost. Can anyone help?

For anyone who is also struggling, these are the URL Parameters that worked for me, as i tried today:

          'authorize_url' => '/oauth/authorize',
          'token_url' => '/oauth/access_token',
          'user_info_url' => '/api/v4/users/me'

Source: Use MM as oauth2 provider for GitLab

1 Like