Skip to content

SlackProvider

Reference doc for the `SlackProvider`.

Use this provider to authenticate with Slack.

import { SlackProvider } from "@openauthjs/openauth/provider/slack"
export default issuer({
providers: {
slack: SlackProvider({
team: "T1234567890",
clientId: "1234567890",
clientSecret: "0987654321",
scopes: ["openid", "email", "profile"]
})
}
})

Methods

SlackProvider

SlackProvider(config)

Parameters

Returns Provider

Creates a Slack OAuth2 provider.

SlackProvider({
team: "T1234567890",
clientId: "1234567890",
clientSecret: "0987654321",
scopes: ["openid", "email", "profile"]
})

SlackConfig

SlackConfig.clientID

Type string

The client ID.

This is just a string to identify your app.

{
clientID: "my-client"
}

SlackConfig.clientSecret

Type string

The client secret.

This is a private key that’s used to authenticate your app. It should be kept secret.

{
clientSecret: "0987654321"
}

SlackConfig.query?

Type Record<string, string>

Any additional parameters that you want to pass to the authorization endpoint.

{
query: {
access_type: "offline",
prompt: "consent"
}
}

SlackConfig.scopes

Type (email | profile | openid)[]

The scopes to request from the user.

ScopeDescription
emailGrants permission to access the user’s email address.
profileGrants permission to access the user’s profile information.
openidGrants permission to use OpenID Connect to verify the user’s identity.

SlackConfig.team

Type string

The workspace the user is intending to authenticate.

If that workspace has been previously authenticated, the user will be signed in directly, bypassing the consent screen.