Skip to content

Commit 0f2cec5

Browse files
committed
chore(sailpoint): cleanup sailpoint page
1 parent de586f6 commit 0f2cec5

File tree

1 file changed

+96
-63
lines changed

1 file changed

+96
-63
lines changed

docs/pages/getting-started/providers/sailpoint.mdx

Lines changed: 96 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@ import { Code } from "@/components/Code"
33

44
<img align="right" src="/img/providers/sailpoint.svg" height="64" width="64" />
55

6-
# SailPoint Identity Secure Cloud Provider
6+
# SailPoint ISC Provider
77

8-
SailPoint Identity Secure Cloud (ISC) is an enterprise SaaS platform for identity and security. In order to use this OAuth integration, you will need an ISC tenant. If you're a SailPoint customer or partner, please talk to your SailPoint account manager for more details. If you are a developer, you can check out the [SailPoint Developer Community](https://developer.sailpoint.com/discuss/).
8+
SailPoint Identity Secure Cloud (ISC) is an enterprise SaaS platform for identity and security. In order to use this OAuth integration, you will need an ISC tenant. If you're a SailPoint customer or partner, please talk to your SailPoint account manager for more details. If you are a developer, check out the [SailPoint Developer Community](https://developer.sailpoint.com/discuss/).
9+
10+
<Callout>
11+
This provider is not shipped with any of the Auth.js packages because it is an
12+
enterprise provider for which we cannot obtain a tenant to test and ensure
13+
compatibility. That being said, we'd like to make providers like these
14+
available to our users, so we will share a copy and paste version of the
15+
provider on respective docs pages like this. The provider configuration below
16+
is provided as-is and has been submitted by a community member with access to
17+
a SailPoint tenant.
18+
</Callout>
919

1020
## Resources
1121

@@ -21,34 +31,48 @@ SailPoint Identity Secure Cloud (ISC) is an enterprise SaaS platform for identit
2131
<Code.Next>
2232

2333
```bash
24-
https://example.com/api/auth/callback/identitySecureCloud
34+
https://example.com/api/auth/callback/sailpoint
2535
```
2636

2737
</Code.Next>
2838
<Code.Svelte>
2939

3040
```bash
31-
https://example.com/auth/callback/identitySecureCloud
41+
https://example.com/auth/callback/sailpoint
3242
```
3343

3444
</Code.Svelte>
45+
<Code.Express>
46+
47+
```bash
48+
https://example.com/auth/callback/sailpoint
49+
```
50+
51+
</Code.Express>
3552
</Code>
3653

3754
### Create OAuth Client
3855

39-
Find your Identity Secure Cloud Tenant OAuth Information which can be found at `https://{tenant}.api.identitynow.com/oauth/info`. Create an OAuth Client (following this [guide](https://documentation.sailpoint.com/saas/help/common/api_keys.html?h=oauth+client#creating-an-api-key)) with grant types: `AUTHORIZATION_TOKEN` and `REFRESH_TOKEN`. Redirect URL should match your version of the Callback URL above. Finally, select the scopes `sp:scope:all`. Note down the generated `clientId` and `clientSecret`.
56+
First, you'll need to create a client in your SailPoint admin console in order to get your `clientId` and `clientSecret`. You can follow this [guide](https://documentation.sailpoint.com/saas/help/common/api_keys.html?h=oauth+client#creating-an-api-key), or follow the main steps below.
57+
58+
1. Create an OAuth Client () with grant types: `AUTHORIZATION_TOKEN` and `REFRESH_TOKEN`.
59+
2. Set the redirect URL to match your callback URL, based on the example above.
60+
3. Finally, select the scopes `sp:scope:all`.
61+
4. Click "**Create**" and note down the generated `clientId` and `clientSecret`.
4062

4163
### Environment Variables
4264

43-
```
44-
ISC_BASE_API_URL=https://{tenant}.api.identitynow.com
45-
ISC_BASE_URL=https://{tenant}.identitynow.com
46-
ISC_CLIENT_ID=
47-
ISC_CLIENT_SECRET=
65+
```sh
66+
AUTH_SAILPOINT_ID=
67+
AUTH_SAILPOINT_SECRET=
68+
AUTH_SAILPOINT_BASE_URL=https://{tenant}.identitynow.com
69+
AUTH_SAILPOINT_BASE_API_URL=https://{tenant}.api.identitynow.com
4870
```
4971

5072
### Configuration
5173

74+
Unlike other Auth.js providers, this cannot be imported from the package (see the note at the top of this page for more details). However, you can copy and paste the following object into your `providers` array to enable this provider.
75+
5276
<Code>
5377
<Code.Next>
5478

@@ -58,26 +82,26 @@ import NextAuth from "next-auth"
5882
export const { handlers, auth, signIn, signOut } = NextAuth({
5983
providers: [
6084
{
61-
id: "identitySecureCloud",
62-
name: "Identity Secure Cloud",
85+
id: "sailpoint",
86+
name: "SailPoint",
6387
type: "oauth",
64-
clientId: process.env.ISC_CLIENT_ID!,
65-
clientSecret: process.env.ISC_CLIENT_SECRET!,
88+
clientId: process.env.AUTH_SAILPOINT_ID!,
89+
clientSecret: process.env.AUTH_SAILPOINT_SECRET!,
6690
authorization: {
67-
url: `${process.env.ISC_BASE_URL!}/oauth/authorize`,
68-
params: { scope: 'sp:scopes:all' },
91+
url: `${process.env.AUTH_SAILPOINT_BASE_URL!}/oauth/authorize`,
92+
params: { scope: "sp:scopes:all" },
6993
},
70-
token: `${process.env.ISC_BASE_API_URL!}/oauth/token`,
71-
userinfo: `${process.env.ISC_BASE_API_URL!}/oauth/userinfo`,
94+
token: `${process.env.AUTH_SAILPOINT_BASE_API_URL!}/oauth/token`,
95+
userinfo: `${process.env.AUTH_SAILPOINT_BASE_API_URL!}/oauth/userinfo`,
7296
profile(profile) {
7397
return {
74-
id: profile.id,
75-
email: profile.email,
76-
name: profile.uid,
77-
image: null
98+
id: profile.id,
99+
email: profile.email,
100+
name: profile.uid,
101+
image: null,
78102
}
79103
},
80-
style: { text: "#011E69", bg: "#fff", logo: "sailpoint.svg" },
104+
style: { brandColor: "#011E69", logo: "sailpoint.svg" },
81105
},
82106
],
83107
})
@@ -100,19 +124,19 @@ export const { handle, signIn, signOut } = SvelteKitAuth({
100124
clientSecret: env.ISC_CLIENT_SECRET!,
101125
authorization: {
102126
url: `${env.ISC_BASE_URL!}/oauth/authorize`,
103-
params: { scope: 'sp:scopes:all' },
127+
params: { scope: "sp:scopes:all" },
104128
},
105129
token: `${env.ISC_BASE_API_URL!}/oauth/token`,
106130
userinfo: `${env.ISC_BASE_API_URL!}/oauth/userinfo`,
107131
profile(profile) {
108132
return {
109-
id: profile.id,
110-
email: profile.email,
111-
name: profile.uid,
112-
image: null
133+
id: profile.id,
134+
email: profile.email,
135+
name: profile.uid,
136+
image: null,
113137
}
114138
},
115-
style: { text: "#011E69", bg: "#fff", logo: "sailpoint.svg" },
139+
style: { brandColor: "#011E69", logo: "sailpoint.svg" },
116140
},
117141
],
118142
})
@@ -124,49 +148,58 @@ export const { handle, signIn, signOut } = SvelteKitAuth({
124148
```ts filename="/src/app.ts"
125149
import { ExpressAuth } from "@auth/express"
126150

127-
app.use("/auth/*", ExpressAuth({ providers: [
128-
{
129-
id: "identitySecureCloud",
130-
name: "Identity Secure Cloud",
131-
type: "oauth",
132-
clientId: process.env.ISC_CLIENT_ID!,
133-
clientSecret: process.env.ISC_CLIENT_SECRET!,
134-
authorization: {
135-
url: `${process.env.ISC_BASE_URL!}/oauth/authorize`,
136-
params: { scope: 'sp:scopes:all' },
137-
},
138-
token: `${process.env.ISC_BASE_API_URL!}/oauth/token`,
139-
userinfo: `${process.env.ISC_BASE_API_URL!}/oauth/userinfo`,
140-
profile(profile) {
141-
return {
151+
app.use(
152+
"/auth/*",
153+
ExpressAuth({
154+
providers: [
155+
{
156+
id: "identitySecureCloud",
157+
name: "Identity Secure Cloud",
158+
type: "oauth",
159+
clientId: process.env.ISC_CLIENT_ID!,
160+
clientSecret: process.env.ISC_CLIENT_SECRET!,
161+
authorization: {
162+
url: `${process.env.ISC_BASE_URL!}/oauth/authorize`,
163+
params: { scope: "sp:scopes:all" },
164+
},
165+
token: `${process.env.ISC_BASE_API_URL!}/oauth/token`,
166+
userinfo: `${process.env.ISC_BASE_API_URL!}/oauth/userinfo`,
167+
profile(profile) {
168+
return {
142169
id: profile.id,
143170
email: profile.email,
144171
name: profile.uid,
145-
image: null
146-
}
172+
image: null,
173+
}
174+
},
175+
style: { brandColor: "#011E69", logo: "sailpoint.svg" },
147176
},
148-
style: { text: "#011E69", bg: "#fff", logo: "sailpoint.svg" },
149-
},
150-
] }))
177+
],
178+
})
179+
)
151180
```
152181

153182
</Code.Express>
154183
</Code>
155184

156-
Your `userprofile` endpoint will return more fields, but by default the [User table](https://authjs.dev/getting-started/database#models) only supports `id`, `name`, `email`, and `image`. Therefore, if you'd like to use any of the following fields, make sure you modify the `User` table schema in whichever adapter / database you're using.
185+
### Profile
186+
187+
The SailPoint `userprofile` endpoint will return more fields, but by default the [User table](/getting-started/database#models) only supports `id`, `name`, `email`, and `image`. Therefore, if you'd like to use any of the following fields and you're using a database adapter with Auth.js, make sure you modify the `User` table schema in whichever adapter and database you're using. Then you can additionally return any of these fields from the `profile` callback above.
188+
189+
The available fields from the SailPoint `userprofile` endpoint response include the following.
157190

158191
```ts
159-
tenant: profile.tenant,
160-
id: profile.id,
161-
uid: profile.uid,
162-
email: profile.email,
163-
phone: profile.phone,
164-
workPhone: profile.workPhone,
165-
firstname: profile.firstname,
166-
lastname: profile.lastname,
167-
capabilities: profile.capabilities,
168-
displayName: profile.displayName,
169-
name: profile.uid
192+
type SailPointProfile = {
193+
tenant: string
194+
id: string
195+
uid: string
196+
email: string
197+
phone: string
198+
workPhone: string
199+
firstname: string
200+
lastname: string
201+
capabilities: string
202+
displayName: string
203+
name: string
204+
}
170205
```
171-
172-
The above fields will all be available in the `profile` callback.

0 commit comments

Comments
 (0)