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
The config for the provider.config
SlackConfig
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.pkce?
Type boolean
Default false
Whether to use PKCE (Proof Key for Code Exchange) for the authorization code flow. Some providers like x.com require this.
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.
Scope | Description |
---|---|
email | Grants permission to access the user’s email address. |
profile | Grants permission to access the user’s profile information. |
openid | Grants 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.