Slack¶
Backend class¶
For Django, add this class path to AUTHENTICATION_BACKENDS. For other
integrations, use the same class path in the framework-specific backend
setting.
Backend name |
Class path |
|---|---|
|
|
Slack
Register a new application at Slack, set the callback URL to
http://example.com/complete/slack/replacingexample.comwith your domain.Fill
Client IDandClient Secretvalues in the settings:SOCIAL_AUTH_SLACK_KEY = '' SOCIAL_AUTH_SLACK_SECRET = ''
Also it’s possible to define extra permissions with:
SOCIAL_AUTH_SLACK_SCOPE = [...]
See auth scopes at Slack OAuth docs.
To allow sign-in only from one Slack workspace, set its workspace ID:
SOCIAL_AUTH_SLACK_TEAM = 'T0123456789'
The backend checks the
team.idreturned by Slack’susers.identityresponse before signing in. Theteamauthorization parameter selects a workspace on Slack’s sign-in page, but does not enforce this restriction. A missing or different workspace ID rejects the sign-in. Configure a workspace ID (starting withT), not a workspace name or Enterprise organization ID (starting withE). Deployments previously using a name or organization ID must update this setting before upgrading.