Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat(studio): Issuer field in SSO form (#46187)

Danny White00afaeac7354
diff --git a/apps/studio/components/interfaces/Organization/SSO/AttributeMapping.tsx b/apps/studio/components/interfaces/Organization/SSO/AttributeMapping.tsx
index 570b7f2b66a..96d8525d08a 100644
--- a/apps/studio/components/interfaces/Organization/SSO/AttributeMapping.tsx
+++ b/apps/studio/components/interfaces/Organization/SSO/AttributeMapping.tsx
@@ -108,17 +108,14 @@ export const AttributeMapping = ({
label="Attribute mapping"
layout="flex-row-reverse"
description={
- <div>
- <p>Map SSO attributes to user fields</p>
- <div className="flex flex-col gap-y-2 my-2 mt-4">
- <p>Presets for supported identity providers:</p>
- <div className="flex flex-wrap items-center gap-2">
- {PROVIDER_PRESETS.map((preset) => (
- <Button key={preset.name} type="outline" onClick={() => applyPreset(preset)}>
- {preset.name}
- </Button>
- ))}
- </div>
+ <div className="flex flex-col gap-2">
+ <p>Map SSO attributes to user fields. Presets for supported identity providers:</p>
+ <div className="flex flex-wrap items-center gap-2">
+ {PROVIDER_PRESETS.map((preset) => (
+ <Button key={preset.name} type="outline" onClick={() => applyPreset(preset)}>
+ {preset.name}
+ </Button>
+ ))}
</div>
</div>
}
diff --git a/apps/studio/components/interfaces/Organization/SSO/JoinOrganizationOnSignup.tsx b/apps/studio/components/interfaces/Organization/SSO/JoinOrganizationOnSignup.tsx
index a862eba674d..bf794b9297d 100644
--- a/apps/studio/components/interfaces/Organization/SSO/JoinOrganizationOnSignup.tsx
+++ b/apps/studio/components/interfaces/Organization/SSO/JoinOrganizationOnSignup.tsx
@@ -30,7 +30,7 @@ export const JoinOrganizationOnSignup = ({
<FormItemLayout
layout="flex-row-reverse"
label="Automatically add users to organization on sign up"
- description="If disabled, users will need to be invited to the organization after signing up"
+ description="If disabled, users will need to be invited to the organization after signing up."
>
<FormControl className="flex items-center gap-2">
<Switch checked={field.value} onCheckedChange={field.onChange} />
diff --git a/apps/studio/components/interfaces/Organization/SSO/SSOAdvancedSettings.tsx b/apps/studio/components/interfaces/Organization/SSO/SSOAdvancedSettings.tsx
new file mode 100644
index 00000000000..5faea44747f
--- /dev/null
+++ b/apps/studio/components/interfaces/Organization/SSO/SSOAdvancedSettings.tsx
@@ -0,0 +1,29 @@
+import type { UseFormReturn } from 'react-hook-form'
+import { FormControl, FormField, Input } from 'ui'
+import { CollapsibleCardSection } from 'ui-patterns/CollapsibleCardSection'
+import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
+
+import type { SSOConfigFormSchema } from './SSOConfig'
+
+export const SSOAdvancedSettings = ({ form }: { form: UseFormReturn<SSOConfigFormSchema> }) => (
+ <CollapsibleCardSection
+ title="Advanced settings"
+ description="Required for enterprise-managed MCP authentication"
+ >
+ <FormField
+ control={form.control}
+ name="idjagIssuerUrl"
+ render={({ field }) => (
+ <FormItemLayout
+ layout="flex-row-reverse"
+ label="IDJAG Issuer"
+ description="The IDJAG issuer URL of your identity provider."
+ >
+ <FormControl>
+ <Input placeholder="https://your-org.okta.com" {...field} />
+ </FormControl>
+ </FormItemLayout>
+ )}
+ />
+ </CollapsibleCardSection>
+)
diff --git a/apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx b/apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx
index 152e46b3e03..e9e697ba9a2 100644
--- a/apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx
+++ b/apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx
@@ -1,4 +1,5 @@
import { zodResolver } from '@hookform/resolvers/zod'
+import { useFlag } from 'common'
import { Trash } from 'lucide-react'
import { useEffect, useEffectEvent, useState } from 'react'
import { SubmitHandler, useForm } from 'react-hook-form'
@@ -11,6 +12,7 @@ import z from 'zod'
import { AttributeMapping } from './AttributeMapping'
import { JoinOrganizationOnSignup } from './JoinOrganizationOnSignup'
+import { SSOAdvancedSettings } from './SSOAdvancedSettings'
import { SSODomains } from './SSODomains'
import { SSOMetadata } from './SSOMetadata'
import { ScaffoldContainer, ScaffoldSection } from '@/components/layouts/Scaffold'
@@ -44,6 +46,7 @@ const FormSchema = z
lastNameMapping: z.array(z.object({ value: z.string().trim() })),
joinOrgOnSignup: z.boolean(),
roleOnJoin: z.string().optional(),
+ idjagIssuerUrl: z.string().trim().optional(),
})
.superRefine((data, ctx) => {
if (!data.enableSpInitiated) return
@@ -91,6 +94,7 @@ const defaultValues = {
lastNameMapping: [{ value: '' }],
joinOrgOnSignup: false,
roleOnJoin: 'Developer',
+ idjagIssuerUrl: '',
}
export const SSOConfig = () => {
@@ -99,6 +103,13 @@ export const SSOConfig = () => {
const { data: organization } = useSelectedOrganizationQuery()
const { hasAccess: hasAccessToSso, isLoading: isLoadingEntitlement } =
useCheckEntitlements('auth.platform.sso')
+ const enterpriseMcpAuthOrgs = useFlag<string>('enableEnterpriseMcpAuth')
+ const showIdjagSettings =
+ typeof enterpriseMcpAuthOrgs === 'string' &&
+ enterpriseMcpAuthOrgs
+ .split(',')
+ .map((s) => s.trim())
+ .includes(organization?.slug ?? '')
const {
data: ssoConfig,
@@ -171,6 +182,7 @@ export const SSOConfig = () => {
user_name_mapping: values.userNameMapping.map((item) => item.value).filter(Boolean),
join_org_on_signup_enabled: values.joinOrgOnSignup,
join_org_on_signup_role: roleOnJoin,
+ idjag_issuer_url: values.idjagIssuerUrl || undefined,
},
}
@@ -207,6 +219,7 @@ export const SSOConfig = () => {
ssoConfig.last_name_mapping?.map((lastName) => ({ value: lastName })) || [],
joinOrgOnSignup: ssoConfig.join_org_on_signup_enabled,
roleOnJoin: ssoConfig.join_org_on_signup_role,
+ idjagIssuerUrl: ssoConfig.idjag_issuer_url ?? '',
})
}
})
@@ -259,27 +272,23 @@ export const SSOConfig = () => {
name="enabled"
render={({ field }) => (
<FormItemLayout
- layout="flex"
+ layout="flex-row-reverse"
label="Enable Single Sign-On"
description={
<>
- Enable and configure SSO for your organization. Learn more about SSO{' '}
+ Enable and configure SSO for your organization.{' '}
<InlineLink
className="text-foreground-lighter hover:text-foreground"
href={`${DOCS_URL}/guides/platform/sso`}
>
- here
+ Learn more
</InlineLink>
.
</>
}
>
<FormControl>
- <Switch
- checked={field.value}
- onCheckedChange={field.onChange}
- size="large"
- />
+ <Switch checked={field.value} onCheckedChange={field.onChange} />
</FormControl>
</FormItemLayout>
)}
@@ -360,6 +369,12 @@ export const SSOConfig = () => {
<CardContent>
<JoinOrganizationOnSignup form={form} />
</CardContent>
+
+ {showIdjagSettings && (
+ <CardContent>
+ <SSOAdvancedSettings form={form} />
+ </CardContent>
+ )}
</>
)}
diff --git a/apps/studio/components/interfaces/Organization/SSO/SSOMetadata.tsx b/apps/studio/components/interfaces/Organization/SSO/SSOMetadata.tsx
index 1138daeebae..bd270e2bb51 100644
--- a/apps/studio/components/interfaces/Organization/SSO/SSOMetadata.tsx
+++ b/apps/studio/components/interfaces/Organization/SSO/SSOMetadata.tsx
@@ -61,7 +61,7 @@ export const SSOMetadata = ({
<FormItemLayout
label="Metadata"
layout="flex-row-reverse"
- description="Provide a link to your metadata .xml file or upload one"
+ description="Provide a link to your metadata .xml file or upload one."
className="gap-1"
>
<div className=" w-96">
diff --git a/packages/api-types/types/api.d.ts b/packages/api-types/types/api.d.ts
index 362b857dd5b..1c01c92840a 100644
--- a/packages/api-types/types/api.d.ts
+++ b/packages/api-types/types/api.d.ts
@@ -195,7 +195,10 @@ export interface paths {
}
get?: never
put?: never
- /** [Beta] Exchange auth code for user's access and refresh token */
+ /**
+ * [Beta] Exchange auth code for user's access and refresh token
+ * @description Supports `authorization_code`, `refresh_token`, and `urn:ietf:params:oauth:grant-type:jwt-bearer` grant types. The `jwt-bearer` grant type (IDJAG — identity-directed JWT assertion) is in beta and available on Team and Enterprise plans only.
+ */
post: operations['v1-exchange-oauth-token']
delete?: never
options?: never
@@ -3485,13 +3488,18 @@ export interface components {
* "scope": "projects:read projects:write"
* } */
OAuthTokenBody: {
+ /** @description IDJAG assertion JWT for grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer. Beta - available on Team and Enterprise plans only. */
+ assertion?: string
/** Format: uuid */
client_id?: string
client_secret?: string
code?: string
code_verifier?: string
/** @enum {string} */
- grant_type?: 'authorization_code' | 'refresh_token'
+ grant_type?:
+ | 'authorization_code'
+ | 'refresh_token'
+ | 'urn:ietf:params:oauth:grant-type:jwt-bearer'
redirect_uri?: string
refresh_token?: string
/**
@@ -3504,7 +3512,8 @@ export interface components {
OAuthTokenResponse: {
access_token: string
expires_in: number
- refresh_token: string
+ /** @description The `urn:ietf:params:oauth:grant-type:jwt-bearer` grant type issues access tokens only, no refresh token is returned and the token cannot be revoked via `/v1/oauth/revoke`. */
+ refresh_token?: string
/** @enum {string} */
token_type: 'Bearer'
}
@@ -3643,8 +3652,21 @@ export interface components {
PostgresConfigResponse: {
/** @description Default unit: s */
checkpoint_timeout?: string
+ 'cron.log_statement'?: boolean
effective_cache_size?: string
hot_standby_feedback?: boolean
+ /** @description Default unit: ms */
+ log_autovacuum_min_duration?: string
+ log_checkpoints?: boolean
+ log_connections?: boolean
+ log_disconnections?: boolean
+ log_duration?: boolean
+ log_lock_waits?: boolean
+ log_recovery_conflict_waits?: boolean
+ log_replication_commands?: boolean
+ /** @description Default unit: ms */
+ log_startup_progress_interval?: string
+ log_temp_files?: string
logical_decoding_work_mem?: string
maintenance_work_mem?: string
max_connections?: number
@@ -4511,8 +4533,21 @@ export interface components {
UpdatePostgresConfigBody: {
/** @description Default unit: s */
checkpoint_timeout?: string
+ 'cron.log_statement'?: boolean
effective_cache_size?: string
hot_standby_feedback?: boolean
+ /** @description Default unit: ms */
+ log_autovacuum_min_duration?: string
+ log_checkpoints?: boolean
+ log_connections?: boolean
+ log_disconnections?: boolean
+ log_duration?: boolean
+ log_lock_waits?: boolean
+ log_recovery_conflict_waits?: boolean
+ log_replication_commands?: boolean
+ /** @description Default unit: ms */
+ log_startup_progress_interval?: string
+ log_temp_files?: string
logical_decoding_work_mem?: string
maintenance_work_mem?: string
max_connections?: number
@@ -5789,7 +5824,7 @@ export interface operations {
}
}
responses: {
- 201: {
+ 200: {
headers: {
[name: string]: unknown
}
@@ -9912,7 +9947,7 @@ export interface operations {
}
content?: never
}
- /** @description Feature requires a higher plan */
+ /** @description This feature requires the Enterprise organization plan. */
402: {
headers: {
[name: string]: unknown
@@ -9987,7 +10022,7 @@ export interface operations {
}
content?: never
}
- /** @description Feature requires a higher plan */
+ /** @description This feature requires the Enterprise organization plan. */
402: {
headers: {
[name: string]: unknown
@@ -12218,6 +12253,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -13000,6 +13042,13 @@ export interface operations {
'application/json': components['schemas']['VanitySubdomainConfigResponse']
}
}
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 400: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Unauthorized */
401: {
headers: {
@@ -13102,6 +13151,13 @@ export interface operations {
'application/json': components['schemas']['ActivateVanitySubdomainResponse']
}
}
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 400: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Unauthorized */
401: {
headers: {
@@ -13156,6 +13212,13 @@ export interface operations {
'application/json': components['schemas']['SubdomainAvailabilityResponse']
}
}
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 400: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Unauthorized */
401: {
headers: {
diff --git a/packages/api-types/types/platform.d.ts b/packages/api-types/types/platform.d.ts
index ba5359d3206..0b423d0f6ba 100644
--- a/packages/api-types/types/platform.d.ts
+++ b/packages/api-types/types/platform.d.ts
@@ -6197,6 +6197,8 @@ export interface components {
email_mapping: string[]
enabled: boolean
first_name_mapping?: string[]
+ /** Format: uri */
+ idjag_issuer_url?: string | null
join_org_on_signup_enabled: boolean
/** @enum {string} */
join_org_on_signup_role?: 'Administrator' | 'Developer' | 'Owner' | 'Read-only'
@@ -6212,6 +6214,8 @@ export interface components {
email_mapping: string[]
enabled: boolean
first_name_mapping?: string[]
+ /** Format: uri */
+ idjag_issuer_url?: string | null
join_org_on_signup_enabled: boolean
/** @enum {string} */
join_org_on_signup_role?: 'Administrator' | 'Developer' | 'Owner' | 'Read-only'
@@ -6227,6 +6231,8 @@ export interface components {
email_mapping: string[]
enabled: boolean
first_name_mapping?: string[]
+ /** Format: uri */
+ idjag_issuer_url?: string | null
join_org_on_signup_enabled: boolean
/** @enum {string} */
join_org_on_signup_role?: 'Administrator' | 'Developer' | 'Owner' | 'Read-only'
@@ -6242,6 +6248,8 @@ export interface components {
email_mapping: string[]
enabled: boolean
first_name_mapping?: string[]
+ /** Format: uri */
+ idjag_issuer_url?: string | null
join_org_on_signup_enabled: boolean
/** @enum {string} */
join_org_on_signup_role?: 'Administrator' | 'Developer' | 'Owner' | 'Read-only'
@@ -7077,6 +7085,8 @@ export interface components {
email_mapping: string[]
enabled: boolean
first_name_mapping?: string[]
+ /** Format: uri */
+ idjag_issuer_url?: string | null
join_org_on_signup_enabled: boolean
/** @enum {string} */
join_org_on_signup_role?: 'Administrator' | 'Developer' | 'Owner' | 'Read-only'
@@ -7092,6 +7102,8 @@ export interface components {
email_mapping: string[]
enabled: boolean
first_name_mapping?: string[]
+ /** Format: uri */
+ idjag_issuer_url?: string | null
join_org_on_signup_enabled: boolean
/** @enum {string} */
join_org_on_signup_role?: 'Administrator' | 'Developer' | 'Owner' | 'Read-only'
@@ -11766,6 +11778,8 @@ export interface components {
email_mapping: string[]
enabled: boolean
first_name_mapping?: string[]
+ /** Format: uri */
+ idjag_issuer_url?: string | null
join_org_on_signup_enabled: boolean
/** @enum {string} */
join_org_on_signup_role?: 'Administrator' | 'Developer' | 'Owner' | 'Read-only'
@@ -11781,6 +11795,8 @@ export interface components {
email_mapping: string[]
enabled: boolean
first_name_mapping?: string[]
+ /** Format: uri */
+ idjag_issuer_url?: string | null
join_org_on_signup_enabled: boolean
/** @enum {string} */
join_org_on_signup_role?: 'Administrator' | 'Developer' | 'Owner' | 'Read-only'
@@ -11796,6 +11812,8 @@ export interface components {
email_mapping: string[]
enabled: boolean
first_name_mapping?: string[]
+ /** Format: uri */
+ idjag_issuer_url?: string | null
join_org_on_signup_enabled: boolean
/** @enum {string} */
join_org_on_signup_role?: 'Administrator' | 'Developer' | 'Owner' | 'Read-only'
@@ -11811,6 +11829,8 @@ export interface components {
email_mapping: string[]
enabled: boolean
first_name_mapping?: string[]
+ /** Format: uri */
+ idjag_issuer_url?: string | null
join_org_on_signup_enabled: boolean
/** @enum {string} */
join_org_on_signup_role?: 'Administrator' | 'Developer' | 'Owner' | 'Read-only'
@@ -13561,6 +13581,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -14378,6 +14405,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -14431,6 +14465,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -15089,6 +15130,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -17168,6 +17216,13 @@ export interface operations {
'application/json': components['schemas']['OrgDocumentUrlResponse']
}
}
+ /** @description Only organizations on Team, Enterprise or Platform Plan can access our ISO 27001 certificate. */
+ 400: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Unauthorized */
401: {
headers: {
@@ -17211,6 +17266,13 @@ export interface operations {
'application/json': components['schemas']['OrgDocumentUrlResponse']
}
}
+ /** @description Only organizations on Team, Enterprise or Platform Plan can access our SOC2 Type 2 report. */
+ 400: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Unauthorized */
401: {
headers: {
@@ -17254,6 +17316,13 @@ export interface operations {
'application/json': components['schemas']['OrgDocumentUrlResponse']
}
}
+ /** @description Only organizations on Team, Enterprise or Platform Plan can access our standard security questionnaire. */
+ 400: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Unauthorized */
401: {
headers: {
@@ -17850,6 +17919,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -18789,6 +18865,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -21248,6 +21331,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -23497,6 +23587,8 @@ export interface operations {
| 'ram_usage_free'
| 'ram_usage_cache_and_buffers'
| 'ram_usage_swap'
+ | 'ram_commit_used'
+ | 'ram_commit_limit'
| 'swap_usage'
| 'client_connections_pgbouncer'
| 'network_receive_bytes'
@@ -23553,6 +23645,8 @@ export interface operations {
| 'ram_usage_free'
| 'ram_usage_cache_and_buffers'
| 'ram_usage_swap'
+ | 'ram_commit_used'
+ | 'ram_commit_limit'
| 'swap_usage'
| 'client_connections_pgbouncer'
| 'network_receive_bytes'
@@ -24100,7 +24194,7 @@ export interface operations {
}
content?: never
}
- /** @description AWS PrivateLink is not available for the current billing plan. */
+ /** @description Invalid request format */
400: {
headers: {
[name: string]: unknown
@@ -24114,6 +24208,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -24223,6 +24324,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -26285,6 +26393,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {
@@ -26677,6 +26792,13 @@ export interface operations {
}
content?: never
}
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
/** @description Forbidden action */
403: {
headers: {