Skip to content
Migrating from NextAuth.js v4? Read our migration guide.

Mattermost Provider

Resources

Setup

Callback URL

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

Environment Variables

AUTH_MATTERMOST_ID
AUTH_MATTERMOST_SECRET
AUTH_MATTERMOST_ISSUER

Configuration

/auth.ts
import NextAuth from "next-auth"
import Mattermost from "next-auth/providers/mattermost"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [Mattermost],
})

Notes

  • To create your Mattermost OAuth2 app visit http://<your Mattermost instance url>/<your team>/integrations/oauth2-apps
  • 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
Auth.js © Balázs Orbán and Team - 2024