providers/slack
SlackProfile
Extends
Record
<string
,any
>
Indexable
[key
: string
]: any
Properties
date_email_verified
date_email_verified: number;
email: string;
email_verified
email_verified: boolean;
family_name
family_name: string;
given_name
given_name: string;
https://slack.com/team\_domain
https://slack.com/team_domain: string;
https://slack.com/team\_id
https://slack.com/team_id: string;
https://slack.com/team\_image\_102
https://slack.com/team_image_102: string;
https://slack.com/team\_image\_132
https://slack.com/team_image_132: string;
https://slack.com/team\_image\_230
https://slack.com/team_image_230: string;
https://slack.com/team\_image\_34
https://slack.com/team_image_34: string;
https://slack.com/team\_image\_44
https://slack.com/team_image_44: string;
https://slack.com/team\_image\_68
https://slack.com/team_image_68: string;
https://slack.com/team\_image\_88
https://slack.com/team_image_88: string;
https://slack.com/team\_image\_default
https://slack.com/team_image_default: boolean;
https://slack.com/team\_name
https://slack.com/team_name: string;
https://slack.com/user\_id
https://slack.com/user_id: string;
https://slack.com/user\_image\_1024
https://slack.com/user_image_1024: string;
https://slack.com/user\_image\_192
https://slack.com/user_image_192: string;
https://slack.com/user\_image\_24
https://slack.com/user_image_24: string;
https://slack.com/user\_image\_32
https://slack.com/user_image_32: string;
https://slack.com/user\_image\_48
https://slack.com/user_image_48: string;
https://slack.com/user\_image\_512
https://slack.com/user_image_512: string;
https://slack.com/user\_image\_72
https://slack.com/user_image_72: string;
locale
locale: string;
name
name: string;
ok
ok: boolean;
picture
picture: string;
sub
sub: string;
default()
function default<P>(options): OAuthConfig<P>
Add Slack login to your page.
Setup
Callback URL
https://example.com/api/auth/callback/slack
Configuration
import { Auth } from "@auth/core"
import Slack from "@auth/core/providers/slack"
const request = new Request(origin)
const response = await Auth(request, {
providers: [
Slack({ clientId: SLACK_CLIENT_ID, clientSecret: SLACK_CLIENT_SECRET }),
],
})
Resources
Notes
By default, Auth.js assumes that the Slack provider is based on the Open ID Connect specification.
Slack requires that the redirect URL of your app uses https, even for local development.
An easy workaround for this is using a service like ngrok that creates a secure tunnel to your app, using https. Remember to set the url as NEXTAUTH_URL
as well.
The Slack provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.
Disclaimer If you think you found a bug in the default configuration, you can open an issue.
Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.
Type Parameters
Type Parameter |
---|
P extends SlackProfile |
Parameters
Parameter | Type |
---|---|
options | OAuthUserConfig <P > |
Returns
OAuthConfig
<P
>