Skip to main content
Slack plan: Business+ or Enterprise Grid required.
Prefer a managed option? Tightknit offers a hosted SSO integration that handles identity provider configuration, membership checks, and error handling without Auth0 or another identity provider. Contact [email protected] to learn more.
This guide sets up Slack SAML single sign-on with Auth0 as the identity provider. If members sign in to Auth0 with a social connection such as Google or Microsoft, you can add a post-login action that checks Tightknit community membership before letting them in to Slack. The same pattern works with any identity provider that supports SAML 2.0.

Prerequisites

  • A Slack workspace on the Business+ or Enterprise Grid plan
  • An Auth0 tenant (the free tier works)

Set up Slack SSO

In Auth0

Auth0 has a pre-built Slack SSO integration that handles the SAML configuration.
1

Create the SSO integration

In the Auth0 Dashboard, go to Applications > SSO Integrations, select Create SSO Integration, and choose Slack Single Sign On.
2

Name it and save

Enter a Name, such as Slack, and your Slack Team Name, then select Save:
  • Business+: your workspace URL slug, such as your-workspace from your-workspace.slack.com
  • Enterprise Grid: your Grid org slug with the .enterprise suffix, such as your-workspace.enterprise
Auth0 New Slack Single Sign On SSO Integration form with Name and Team Name fields

Configure the Slack SSO integration

Auth0 then generates the SAML endpoint URL, issuer URI, and signing certificate you need in Slack.

In Slack

1

Open Slack SSO settings

Go to Settings & administration > Workspace settings > Authentication > SSO Settings, or your org-level SSO page on Enterprise Grid, and select Configure.
2

Fill in the SAML fields

Enter the values from your Auth0 SSO integration:
Slack Configure SSO dialog showing SAML fields filled with Auth0 values

Slack Configure SSO dialog with Auth0 values filled in

3

Set signing and authentication context

Further down the same dialog:
  • AuthnContextClassRef: keep the default, urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
  • SAML Request Signing: leave unchecked unless your identity provider requires signed requests
  • SAML Response Signing: check Sign the Assertion. At least one signing option is required.
Slack SSO signing options showing Sign the Assertion checked under SAML Response Signing

SAML signing options

4

Test and apply

Select Test Configuration. If the test passes, review the configuration and select Apply.
Members can now sign in to your Slack workspace through Auth0. The rest of this guide is optional.

Sign the SAML response (optional)

Signing the assertion alone is secure for most deployments. The assertion carries the user’s identity and authentication claims, so signing it protects the data Slack trusts. Signing the outer response adds a second signature over envelope metadata (issuer, destination, InResponseTo) as defense in depth. The default Auth0 Slack SSO integration signs only the assertion. Sign the full response only if your security team requires signResponse, for example under an internal SAML hardening policy or compliance control. This requires a custom SAML application in place of the pre-built integration:
1

Create a custom SAML application

In Auth0, go to Applications > Applications and create a Regular Web Application. On its Addons tab, enable SAML2 Web App.
2

Set signResponse to true

In the addon settings, set signResponse to true.
Auth0 SAML2 Web App addon settings with signResponse highlighted and annotation to switch to true

Set signResponse to true in the SAML2 addon settings

3

Use the new endpoint in Slack

In the Slack SSO dialog (In Slack), use the SAML endpoint URL and certificate from this custom application instead of the SSO integration.

Check Tightknit community membership (optional)

With a social connection such as Google or Microsoft, anyone with a valid account can authenticate with Auth0, even if they aren’t a member of your community. Identity providers can’t reject people before the social sign-in completes, so this check runs as a post-login action that calls the Tightknit API. Without it, non-members see a broken Slack sign-in failure instead of a clear message. You need:
  • a Google or other social connection enabled in Auth0
  • a Tightknit API key for your community

In Tightknit Studio

1

Get your Tightknit API key

In Studio, go to Integrations > API > API keys and create a key or copy an existing one.
Tightknit Studio API Keys page showing where to create and copy API keys

Tightknit Studio API Keys page

API keys are scoped to your community, so the membership check needs no other headers.

In Auth0

1

Create the post-login action

In the Auth0 Dashboard, go to Actions > Library > Build Custom. Name the action Tightknit Membership Check, select the Login / Post Login trigger, and paste this code:
Auth0 Action
2

Add secrets to the action

In the action editor, select the lock icon (Secrets) and add:
Auth0 Action editor showing the Tightknit Membership Check code and secrets configuration

Auth0 Action editor with secrets panel

clientId and clientSecret belong to the Machine-to-Machine application, not the SAML application. The action uses them only to delete Auth0 users created by non-member sign-ins.
3

Deploy and add the action to the Login flow

Select Deploy in the action editor. Then go to Actions > Flows > Login, drag Tightknit Membership Check into the flow after the default login step, and select Apply.
Auth0 Post Login flow showing the membership check action between Start and Complete

Auth0 Login Flow with the membership check action attached

Force account selection (optional)

By default, Auth0 may skip its login page by reusing a cached session, and Google may select the last-used account automatically. To make people choose an account every time, run these one-time Management API calls. Get a Management API token from Applications > APIs > Auth0 Management API > API Explorer.
1

Turn off Auth0 session reuse

2

Force the Google account picker

Test

1

Sign in as a member

Use Slack SSO with the email address of an active community member. You’re signed in to Slack.
2

Sign in as a non-member

Use an email address that isn’t in your community. You’re redirected to your community’s login page, which shows “An account with this email address does not exist.” or your custom login error message.
3

Check the logs

In Auth0, go to Monitoring > Logs to confirm the action ran. The console.log output appears in the event details.

Error codes

When the action redirects to your login page, the error query parameter sets the message the page shows. For every code, see Login error codes.

Troubleshooting

Confirm the action uses api.redirect.sendUserTo(), not api.access.deny(). deny() sends a failed SAML response that Slack can’t display.
Run the sso_disabled and upstream_params calls in Force account selection.
Confirm the TIGHTKNIT_API_KEY secret is correct. If needed, create a new key. See API keys.
Confirm the action is deployed and added to the Login flow in Actions > Flows > Login.
Confirm the certificate in Slack matches the one from Auth0. If you need a signed response, not only a signed assertion, follow Sign the SAML response.