コンテンツにスキップ
NextAuth.js v4 から移行しますか?以下をお読みください 移行ガイド.

providers/slack

組み込みのSlack連携機能。

SlackProfile

拡張

プロパティ

date_email_verified

date_email_verified: number;

email

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 ログインを追加します。

セットアップ

コールバック 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では、ローカル開発であっても、アプリのリダイレクトURLにhttpsを使用する必要があります。この問題を簡単に回避する方法として、ngrokのようなサービスを利用して、httpsを使用し、アプリへの安全なトンネルを作成する方法があります。このURLをNEXTAUTH_URLとして設定することを忘れないでください。

💡

Slackプロバイダーには、デフォルト設定が付属しています。ユースケースに合わせてデフォルト設定を上書きするには、組み込みのOAuthプロバイダーのカスタマイズを確認してください。

免責事項 デフォルト設定にバグを発見したと思われる場合は、issueをオープンできます。

Auth.jsは仕様に厳密に準拠しており、プロバイダーによる仕様からの逸脱について責任を負うことはできません。issueをオープンできますが、問題が仕様への不適合である場合、解決を追求しない可能性があります。Discussionsでさらにヘルプを求めることができます。

型パラメータ

型パラメータ
P extends SlackProfile

パラメータ

パラメータ
optionsOAuthUserConfig<P>

戻り値

OAuthConfig<P>

Auth.js © Balázs Orbán and Team -2024