providers/slack
SlackProfile
繼承自
Record
<string
,any
>
屬性
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
com/team_domain: string;
https://slack.com/team\_id
com/team_id: string;
https://slack.com/team\_image\_102
com/team_image_102: string;
https://slack.com/team\_image\_132
com/team_image_132: string;
https://slack.com/team\_image\_230
com/team_image_230: string;
https://slack.com/team\_image\_34
com/team_image_34: string;
https://slack.com/team\_image\_44
com/team_image_44: string;
https://slack.com/team\_image\_68
com/team_image_68: string;
https://slack.com/team\_image\_88
com/team_image_88: string;
https://slack.com/team\_image\_default
com/team_image_default: boolean;
https://slack.com/team\_name
com/team_name: string;
https://slack.com/user\_id
com/user_id: string;
https://slack.com/user\_image\_1024
com/user_image_1024: string;
https://slack.com/user\_image\_192
com/user_image_192: string;
https://slack.com/user\_image\_24
com/user_image_24: string;
https://slack.com/user\_image\_32
com/user_image_32: string;
https://slack.com/user\_image\_48
com/user_image_48: string;
https://slack.com/user\_image\_512
com/user_image_512: string;
https://slack.com/user\_image\_72
com/user_image_72: string;
locale
locale: string;
name
name: string;
ok
ok: boolean;
picture
picture: string;
sub
sub: string;
default()
default<P>(options): OAuthConfig<P>
將 Slack 登入功能新增至您的頁面。
設定
回呼網址 (Callback URL)
https://example.com/api/auth/callback/slack
設定組態
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 }),
],
})
資源
注意事項
預設情況下,Auth.js 假設 Slack 提供者基於 Open ID Connect 規範。
🚫
Slack 要求您應用程式的重新導向網址 (redirect URL) 使用 https,即使是本地開發也一樣。一個簡單的解決方案是使用像 ngrok 這樣的服務,它會使用 https 為您的應用程式建立安全的通道。請記得也將網址設定為 NEXTAUTH_URL
。
💡
Slack 提供者帶有預設設定。若要覆寫您的使用案例的預設值,請查看自訂內建 OAuth 提供者。
類型參數
類型參數 |
---|
P 繼承 SlackProfile |
參數
參數 | 類型 |
---|---|
選項 (options) | OAuthUserConfig <P > |
回傳值
OAuthConfig
<P
>