SailPoint ISC 提供者
SailPoint Identity Secure Cloud (ISC) 是一個用於身分和安全的企業 SaaS 平台。為了使用此 OAuth 整合,您需要一個 ISC 租戶。如果您是 SailPoint 客戶或合作夥伴,請洽詢您的 SailPoint 帳戶經理以瞭解更多詳細資訊。如果您是開發人員,請查看 SailPoint 開發人員社群。
💡
此提供者未與任何 Auth.js 套件一起發布,因為它是一個企業提供者,我們無法取得租戶來測試並確保相容性。話雖如此,我們希望讓我們的使用者可以使用這類提供者,因此我們將在各自的說明文件頁面上分享提供者的複製貼上版本,例如此頁面。以下提供者組態按原樣提供,並由具有 SailPoint 租戶存取權的社群成員提交。
資源
設定
回呼 URL
https://example.com/api/auth/callback/sailpoint
建立 OAuth 用戶端
首先,您需要在 SailPoint 管理主控台中建立一個用戶端,以便取得您的 clientId
和 clientSecret
。您可以依照此指南,或依照以下主要步驟進行。
- 建立一個 OAuth 用戶端 (),其授權類型為:
AUTHORIZATION_TOKEN
和REFRESH_TOKEN
。 - 根據上述範例,將重新導向 URL 設定為符合您的回呼 URL。
- 最後,選取
sp:scope:all
範圍。 - 按一下「建立」,並記下產生的
clientId
和clientSecret
。
環境變數
AUTH_SAILPOINT_ID=
AUTH_SAILPOINT_SECRET=
AUTH_SAILPOINT_BASE_URL=https://{tenant}.identitynow.com
AUTH_SAILPOINT_BASE_API_URL=https://{tenant}.api.identitynow.com
組態
與其他 Auth.js 提供者不同,此提供者無法從套件匯入(有關更多詳細資訊,請參閱本頁頂部的註解)。但是,您可以將下列物件複製並貼到您的 providers
陣列中,以啟用此提供者。
/auth.ts
import NextAuth from "next-auth"
export const { handlers, auth, signIn, signOut } = NextAuth({
providers: [
{
id: "sailpoint",
name: "SailPoint",
type: "oauth",
clientId: process.env.AUTH_SAILPOINT_ID!,
clientSecret: process.env.AUTH_SAILPOINT_SECRET!,
authorization: {
url: `${process.env.AUTH_SAILPOINT_BASE_URL!}/oauth/authorize`,
params: { scope: "sp:scopes:all" },
},
token: `${process.env.AUTH_SAILPOINT_BASE_API_URL!}/oauth/token`,
userinfo: `${process.env.AUTH_SAILPOINT_BASE_API_URL!}/oauth/userinfo`,
profile(profile) {
return {
id: profile.id,
email: profile.email,
name: profile.uid,
image: null,
}
},
style: { brandColor: "#011E69", logo: "sailpoint.svg" },
},
],
})
個人資料
SailPoint userprofile
端點將傳回更多欄位,但預設情況下,User 資料表僅支援 id
、name
、email
和 image
。因此,如果您想使用以下任何欄位,並且您正在搭配 Auth.js 使用資料庫轉接器,請務必修改您正在使用的任何轉接器和資料庫中的 User
資料表結構描述。然後,您可以另外從上述 profile
回呼傳回任何這些欄位。
來自 SailPoint userprofile
端點回應的可用欄位包括以下內容。
type SailPointProfile = {
tenant: string
id: string
uid: string
email: string
phone: string
workPhone: string
firstname: string
lastname: string
capabilities: string
displayName: string
name: string
}