Skip to main content

providers/mattermost

Built-in Mattermost integration.

default()​

default<P>(config): OAuthConfig< P >

Add Mattermost login to your page.

Setup​

Callback URL​

https://example.com/api/auth/callback/mattermost

Configuration​

import Auth from "@auth/core"
import Mattermost from "@auth/core/providers/mattermost"

const request = new Request(origin)
const response = await Auth(request, {
providers: [Mattermost({ clientId: MATTERMOST_CLIENT_ID, clientSecret: MATTERMOST_CLIENT_SECRET, issuer: MATTERMOST_ISSUER // The base url of your Mattermost instance. e.g `https://my-cool-server.cloud.mattermost.com` })],
})

Resources​

Notes​

By default, Auth.js assumes that the Mattermost provider is based on the OAuth 2 specification.

To create your Mattermost OAuth2 app visit http://<your Mattermost instance url>/<your team>/integrations/oauth2-apps

warning

The Mattermost provider requires the issuer option to be set. This is the base url of your Mattermost instance. e.g https://my-cool-server.cloud.mattermost.com

tip

The Mattermost provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.

Disclaimer

If you think you found a bug in the default configuration, you can open an issue.

Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.

Type parameters​

β–ͺ P extends MattermostProfile

Parameters​

β–ͺ config: OAuthUserConfig< P > & object

Returns​

OAuthConfig< P >


MattermostProfile​

Get a user

Properties​

create_at​

create_at: number

The time in milliseconds a user was created

delete_at​

delete_at: number

The time in milliseconds a user was deleted

update_at​

update_at: number

The time in milliseconds a user was last updated

terms_of_service_create_at​

terms_of_service_create_at?: number

The time in milliseconds the user accepted the terms of service

terms_of_service_id​

terms_of_service_id?: string

ID of accepted terms of service, if any. This field is not present if empty.