-
Notifications
You must be signed in to change notification settings - Fork 515
feat : add Okta Provider #1043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feat : add Okta Provider #1043
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -14,6 +14,7 @@ import { GoogleProvider } from "./providers/google"; | |||||
| import { LinkedInProvider } from "./providers/linkedin"; | ||||||
| import { MicrosoftProvider } from "./providers/microsoft"; | ||||||
| import { MockProvider } from "./providers/mock"; | ||||||
| import { OktaProvider } from "./providers/okta"; | ||||||
| import { SpotifyProvider } from "./providers/spotify"; | ||||||
| import { TwitchProvider } from "./providers/twitch"; | ||||||
| import { XProvider } from "./providers/x"; | ||||||
|
|
@@ -31,6 +32,7 @@ const _providers = { | |||||
| linkedin: LinkedInProvider, | ||||||
| x: XProvider, | ||||||
| twitch: TwitchProvider, | ||||||
| okta:OktaProvider, | ||||||
| } as const; | ||||||
|
|
||||||
| const mockProvider = MockProvider; | ||||||
|
|
@@ -78,6 +80,7 @@ export async function getProvider(provider: Tenancy['config']['auth']['oauth'][' | |||||
| clientSecret: provider.clientSecret || throwErr("Client secret is required for standard providers"), | ||||||
| facebookConfigId: provider.facebookConfigId, | ||||||
| microsoftTenantId: provider.microsoftTenantId, | ||||||
| oktaDomain:provider.oktaDomain, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: missing space after colon
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/backend/src/oauth/index.tsx
Line: 83:83
Comment:
**style:** missing space after colon
```suggestion
oktaDomain: provider.oktaDomain,
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The View Details📝 Patch Detailsdiff --git a/apps/backend/src/app/api/latest/integrations/neon/oauth-providers/crud.tsx b/apps/backend/src/app/api/latest/integrations/neon/oauth-providers/crud.tsx
index 858018bc..73498f06 100644
--- a/apps/backend/src/app/api/latest/integrations/neon/oauth-providers/crud.tsx
+++ b/apps/backend/src/app/api/latest/integrations/neon/oauth-providers/crud.tsx
@@ -22,6 +22,7 @@ const oauthProviderReadSchema = yupObject({
// extra params
facebook_config_id: schemaFields.oauthFacebookConfigIdSchema.optional(),
microsoft_tenant_id: schemaFields.oauthMicrosoftTenantIdSchema.optional(),
+ okta_issuer: schemaFields.oauthOktaIssuerSchema.optional(),
});
const oauthProviderUpdateSchema = yupObject({
@@ -38,6 +39,7 @@ const oauthProviderUpdateSchema = yupObject({
// extra params
facebook_config_id: schemaFields.oauthFacebookConfigIdSchema.optional(),
microsoft_tenant_id: schemaFields.oauthMicrosoftTenantIdSchema.optional(),
+ okta_issuer: schemaFields.oauthOktaIssuerSchema.optional(),
});
const oauthProviderCreateSchema = oauthProviderUpdateSchema.defined().concat(yupObject({
@@ -77,6 +79,7 @@ function oauthProviderConfigToLegacyConfig(provider: Tenancy['config']['auth']['
client_secret: provider.clientSecret,
facebook_config_id: provider.facebookConfigId,
microsoft_tenant_id: provider.microsoftTenantId,
+ okta_issuer: provider.oktaIssuer,
} as const;
}
diff --git a/apps/backend/src/lib/config.tsx b/apps/backend/src/lib/config.tsx
index 0838f3d4..d3480cac 100644
--- a/apps/backend/src/lib/config.tsx
+++ b/apps/backend/src/lib/config.tsx
@@ -518,6 +518,7 @@ export const renderedOrganizationConfigToProjectCrud = (renderedConfig: Complete
client_secret: oauthProvider.clientSecret,
facebook_config_id: oauthProvider.facebookConfigId,
microsoft_tenant_id: oauthProvider.microsoftTenantId,
+ okta_issuer: oauthProvider.oktaIssuer,
} as const) satisfies ProjectsCrud["Admin"]["Read"]['config']['oauth_providers'][number];
})
.filter(isTruthy)
diff --git a/apps/backend/src/lib/projects.tsx b/apps/backend/src/lib/projects.tsx
index 713ac097..d698d913 100644
--- a/apps/backend/src/lib/projects.tsx
+++ b/apps/backend/src/lib/projects.tsx
@@ -188,6 +188,7 @@ export async function createOrUpdateProjectWithLegacyConfig(
clientSecret: provider.client_secret,
facebookConfigId: provider.facebook_config_id,
microsoftTenantId: provider.microsoft_tenant_id,
+ oktaIssuer: provider.okta_issuer,
allowSignIn: true,
allowConnectedAccounts: true,
} satisfies CompleteConfig['auth']['oauth']['providers'][string]
diff --git a/apps/backend/src/oauth/index.tsx b/apps/backend/src/oauth/index.tsx
index 616a0a7c..ac20ca53 100644
--- a/apps/backend/src/oauth/index.tsx
+++ b/apps/backend/src/oauth/index.tsx
@@ -80,7 +80,7 @@ export async function getProvider(provider: Tenancy['config']['auth']['oauth']['
clientSecret: provider.clientSecret || throwErr("Client secret is required for standard providers"),
facebookConfigId: provider.facebookConfigId,
microsoftTenantId: provider.microsoftTenantId,
- oktaDomain:provider.oktaDomain,
+ okta_issuer: provider.oktaIssuer,
});
}
}
diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/providers.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/providers.tsx
index 7e262d36..e2f3afe4 100644
--- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/providers.tsx
+++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/providers.tsx
@@ -64,7 +64,7 @@ export const providerFormSchema = yupObject({
}),
facebookConfigId: yupString().optional(),
microsoftTenantId: yupString().optional(),
- oktaDomain:yupString().optional()
+ oktaIssuer:yupString().optional()
});
export type ProviderFormValues = yup.InferType<typeof providerFormSchema>
@@ -77,7 +77,7 @@ export function ProviderSettingDialog(props: Props & { open: boolean, onClose: (
clientSecret: (props.provider as any)?.clientSecret ?? "",
facebookConfigId: (props.provider as any)?.facebookConfigId ?? "",
microsoftTenantId: (props.provider as any)?.microsoftTenantId ?? "",
- oktaDomain:(props.provider as any)?.oktaDomain??"",
+ oktaIssuer:(props.provider as any)?.oktaIssuer??"",
};
const onSubmit = async (values: ProviderFormValues) => {
@@ -91,7 +91,7 @@ export function ProviderSettingDialog(props: Props & { open: boolean, onClose: (
clientSecret: values.clientSecret || "",
facebookConfigId: values.facebookConfigId,
microsoftTenantId: values.microsoftTenantId,
- oktaDomain:values.oktaDomain,
+ oktaIssuer:values.oktaIssuer,
});
}
};
@@ -171,12 +171,12 @@ export function ProviderSettingDialog(props: Props & { open: boolean, onClose: (
/>
)}
- {props.id === 'Okta' && (
+ {props.id === 'okta' && (
<InputField
control={form.control}
- name="oktaDomain"
- label="Okta Domain (required if you are using Okta)"
- placeholder="oktaDomain"
+ name="oktaIssuer"
+ label="Okta Issuer URL (required if you are using Okta)"
+ placeholder="https://your-domain.okta.com"
/>
)}
</>
diff --git a/packages/stack-shared/src/config/schema-fuzzer.test.ts b/packages/stack-shared/src/config/schema-fuzzer.test.ts
index 36475954..dded169c 100644
--- a/packages/stack-shared/src/config/schema-fuzzer.test.ts
+++ b/packages/stack-shared/src/config/schema-fuzzer.test.ts
@@ -180,6 +180,7 @@ const environmentSchemaFuzzerConfig = [{
clientSecret: ["some-client-secret"],
facebookConfigId: ["some-facebook-config-id"],
microsoftTenantId: ["some-microsoft-tenant-id"],
+ oktaIssuer: ["https://example.okta.com"],
}]]))] as const,
}],
}],
diff --git a/packages/stack-shared/src/config/schema.ts b/packages/stack-shared/src/config/schema.ts
index 8835d595..73a55947 100644
--- a/packages/stack-shared/src/config/schema.ts
+++ b/packages/stack-shared/src/config/schema.ts
@@ -223,6 +223,7 @@ export const environmentConfigSchema = branchConfigSchema.concat(yupObject({
clientSecret: schemaFields.oauthClientSecretSchema.optional(),
facebookConfigId: schemaFields.oauthFacebookConfigIdSchema.optional(),
microsoftTenantId: schemaFields.oauthMicrosoftTenantIdSchema.optional(),
+ oktaIssuer: schemaFields.oauthOktaIssuerSchema.optional(),
allowSignIn: yupBoolean().optional(),
allowConnectedAccounts: yupBoolean().optional(),
}),
@@ -507,6 +508,7 @@ const organizationConfigDefaults = {
clientSecret: undefined,
facebookConfigId: undefined,
microsoftTenantId: undefined,
+ oktaIssuer: undefined,
}),
},
},
diff --git a/packages/stack-shared/src/interface/crud/projects.ts b/packages/stack-shared/src/interface/crud/projects.ts
index b37713c2..45264e2e 100644
--- a/packages/stack-shared/src/interface/crud/projects.ts
+++ b/packages/stack-shared/src/interface/crud/projects.ts
@@ -22,6 +22,7 @@ const oauthProviderReadSchema = yupObject({
// extra params
facebook_config_id: schemaFields.oauthFacebookConfigIdSchema.optional(),
microsoft_tenant_id: schemaFields.oauthMicrosoftTenantIdSchema.optional(),
+ okta_issuer: schemaFields.oauthOktaIssuerSchema.optional(),
});
const oauthProviderWriteSchema = oauthProviderReadSchema.omit(['provider_config_id']);
diff --git a/packages/stack-shared/src/schema-fields.ts b/packages/stack-shared/src/schema-fields.ts
index ca6f9c22..1e3e682f 100644
--- a/packages/stack-shared/src/schema-fields.ts
+++ b/packages/stack-shared/src/schema-fields.ts
@@ -527,6 +527,7 @@ export const oauthClientIdSchema = yupString().meta({ openapiField: { descriptio
export const oauthClientSecretSchema = yupString().meta({ openapiField: { description: 'OAuth client secret. Needs to be specified when using type="standard"', exampleValue: 'google-oauth-client-secret' } });
export const oauthFacebookConfigIdSchema = yupString().meta({ openapiField: { description: 'The configuration id for Facebook business login (for things like ads and marketing). This is only required if you are using the standard OAuth with Facebook and you are using Facebook business login.' } });
export const oauthMicrosoftTenantIdSchema = yupString().meta({ openapiField: { description: 'The Microsoft tenant id for Microsoft directory. This is only required if you are using the standard OAuth with Microsoft and you have an Azure AD tenant.' } });
+export const oauthOktaIssuerSchema = yupString().meta({ openapiField: { description: 'The Okta issuer URL. This is required if you are using the standard OAuth with Okta.' } });
export const oauthAccountMergeStrategySchema = yupString().oneOf(['link_method', 'raise_error', 'allow_duplicates']).meta({ openapiField: { description: 'Determines how to handle OAuth logins that match an existing user by email. `link_method` adds the OAuth method to the existing user. `raise_error` rejects the login with an error. `allow_duplicates` creates a new user.', exampleValue: 'link_method' } });
// Project email config
export const emailTypeSchema = yupString().oneOf(['shared', 'standard']).meta({ openapiField: { description: 'Email provider type, one of shared, standard. "shared" uses Stack shared email provider and it is only meant for development. "standard" uses your own email server and will have your email address as the sender.', exampleValue: 'standard' } });
AnalysisOkta OAuth Provider Configuration Missing Required FieldWhat fails: OktaProvider.create() expects an How to reproduce:
Result: The Okta provider fails initialization because Expected: Okta provider should receive the configured issuer URL and properly initialize the OAuth flow. Fix:
|
||||||
| }); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,79 @@ | ||||||
| import { getEnvVariable } from "@stackframe/stack-shared/dist/utils/env"; | ||||||
| import { StackAssertionError } from "@stackframe/stack-shared/dist/utils/errors"; | ||||||
| import { getJwtInfo } from "@stackframe/stack-shared/dist/utils/jwt"; | ||||||
| import { OAuthUserInfo, validateUserInfo } from "../utils"; | ||||||
| import { OAuthBaseProvider, TokenSet } from "./base"; | ||||||
|
|
||||||
|
|
||||||
| export class OktaProvider extends OAuthBaseProvider { | ||||||
| private oktaDomain : string; | ||||||
| private constructor( | ||||||
| oktaDomain: string, | ||||||
| ...args: ConstructorParameters<typeof OAuthBaseProvider> | ||||||
| ) { | ||||||
| super(...args); | ||||||
| this.oktaDomain = oktaDomain | ||||||
| } | ||||||
|
|
||||||
| static async create(options: { | ||||||
| clientId: string; | ||||||
| clientSecret: string; | ||||||
| okta_issuer: string; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: parameter name mismatch - receives
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/backend/src/oauth/providers/okta.tsx
Line: 21:21
Comment:
**logic:** parameter name mismatch - receives `oktaDomain` from `oauth/index.tsx:83` but expects `okta_issuer`
```suggestion
oktaDomain: string;
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||
| }) { | ||||||
| const oktaDomain = options.okta_issuer; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: reading from wrong parameter name - should be
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/backend/src/oauth/providers/okta.tsx
Line: 23:23
Comment:
**logic:** reading from wrong parameter name - should be `options.oktaDomain`
```suggestion
const oktaDomain = options.oktaDomain;
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||
|
|
||||||
| if(!oktaDomain) throw new StackAssertionError("Okta domain is required ") | ||||||
|
|
||||||
| return new OktaProvider( | ||||||
| oktaDomain, | ||||||
| ...await OAuthBaseProvider.createConstructorArgs({ | ||||||
| issuer: `https://${oktaDomain}`, | ||||||
| authorizationEndpoint: `${oktaDomain}/v1/authorize`, | ||||||
| tokenEndpoint: `${oktaDomain}/v1/token`, | ||||||
| redirectUri: getEnvVariable("OAUTH_REDIRECT_URI")!, | ||||||
| jwksUri: `${oktaDomain}/v1/keys`, | ||||||
|
vercel[bot] marked this conversation as resolved.
Outdated
|
||||||
| baseScope: "openid email profile", | ||||||
| authorizationExtraParams: { response_mode: "form_post" }, | ||||||
| tokenEndpointAuthMethod: "client_secret_basic", | ||||||
| ...options, | ||||||
| })) | ||||||
| ; | ||||||
| } | ||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||
|
|
||||||
| async postProcessUserInfo(tokenSet: TokenSet): Promise<OAuthUserInfo> { | ||||||
| const rawUserInfoRes = await fetch(`${this.oktaDomain}/v1/userinfo`, { | ||||||
| headers: { | ||||||
| Authorization: `Bearer ${tokenSet.accessToken}`, | ||||||
| }, | ||||||
| }); | ||||||
|
|
||||||
| if (!rawUserInfoRes.ok) { | ||||||
| throw new StackAssertionError( | ||||||
| "Error fetching user information from Okta", | ||||||
| { | ||||||
| status: rawUserInfoRes.status, | ||||||
| body: await rawUserInfoRes.text(), | ||||||
| jwtInfo: await getJwtInfo({ jwt: tokenSet.accessToken }), | ||||||
| } | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
| const rawUserInfo = await rawUserInfoRes.json(); | ||||||
|
|
||||||
| return validateUserInfo({ | ||||||
| accountId: rawUserInfo.sub, | ||||||
| displayName: rawUserInfo.name, | ||||||
| profileImageUrl: rawUserInfo.picture, | ||||||
| email: rawUserInfo.email, | ||||||
| emailVerified: rawUserInfo.email_verified, | ||||||
| }); | ||||||
| } | ||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||
| async checkAccessTokenValidity(accessToken: string): Promise<boolean> { | ||||||
| const res = await fetch(`${this.oktaDomain}/v1/userinfo`, { | ||||||
| headers: { | ||||||
| Authorization: `Bearer ${accessToken}`, | ||||||
| }, | ||||||
| }); | ||||||
| return res.ok; | ||||||
| } | ||||||
| } | ||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,6 +44,7 @@ function toTitle(id: string) { | |||||||||||||||||||||||||||||||||
| linkedin: "LinkedIn", | ||||||||||||||||||||||||||||||||||
| twitch: "Twitch", | ||||||||||||||||||||||||||||||||||
| x: "X", | ||||||||||||||||||||||||||||||||||
| okta:"Okta" | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: missing space after colon
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/providers.tsx
Line: 47:47
Comment:
**style:** missing space after colon
```suggestion
okta: "Okta"
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||||||||||||||||||
| }[id]; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
@@ -63,6 +64,7 @@ export const providerFormSchema = yupObject({ | |||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||
| facebookConfigId: yupString().optional(), | ||||||||||||||||||||||||||||||||||
| microsoftTenantId: yupString().optional(), | ||||||||||||||||||||||||||||||||||
| oktaDomain:yupString().optional() | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: missing space after colon
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/providers.tsx
Line: 67:67
Comment:
**style:** missing space after colon
```suggestion
oktaDomain: yupString().optional()
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export type ProviderFormValues = yup.InferType<typeof providerFormSchema> | ||||||||||||||||||||||||||||||||||
|
|
@@ -75,6 +77,7 @@ export function ProviderSettingDialog(props: Props & { open: boolean, onClose: ( | |||||||||||||||||||||||||||||||||
| clientSecret: (props.provider as any)?.clientSecret ?? "", | ||||||||||||||||||||||||||||||||||
| facebookConfigId: (props.provider as any)?.facebookConfigId ?? "", | ||||||||||||||||||||||||||||||||||
| microsoftTenantId: (props.provider as any)?.microsoftTenantId ?? "", | ||||||||||||||||||||||||||||||||||
| oktaDomain:(props.provider as any)?.oktaDomain??"", | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: missing spaces after colons
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/providers.tsx
Line: 80:80
Comment:
**style:** missing spaces after colons
```suggestion
oktaDomain: (props.provider as any)?.oktaDomain ?? "",
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| const onSubmit = async (values: ProviderFormValues) => { | ||||||||||||||||||||||||||||||||||
|
|
@@ -88,6 +91,7 @@ export function ProviderSettingDialog(props: Props & { open: boolean, onClose: ( | |||||||||||||||||||||||||||||||||
| clientSecret: values.clientSecret || "", | ||||||||||||||||||||||||||||||||||
| facebookConfigId: values.facebookConfigId, | ||||||||||||||||||||||||||||||||||
| microsoftTenantId: values.microsoftTenantId, | ||||||||||||||||||||||||||||||||||
| oktaDomain:values.oktaDomain, | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: missing space after colon
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/providers.tsx
Line: 94:94
Comment:
**style:** missing space after colon
```suggestion
oktaDomain: values.oktaDomain,
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||
|
|
@@ -166,6 +170,15 @@ export function ProviderSettingDialog(props: Props & { open: boolean, onClose: ( | |||||||||||||||||||||||||||||||||
| placeholder="Tenant ID" | ||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| {props.id === 'Okta' && ( | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: case mismatch - should be
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/providers.tsx
Line: 174:174
Comment:
**logic:** case mismatch - should be `'okta'` (lowercase) to match the provider key in `toTitle` function and backend
```suggestion
{props.id === 'okta' && (
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The condition checks for View DetailsAnalysisOkta domain input field never renders due to incorrect provider ID caseWhat fails: The Okta domain input field is never displayed in the OAuth provider configuration dialog, preventing users from entering the required Okta domain when setting up Okta OAuth authentication. How to reproduce:
Root cause: The condition at line 174 in Expected behavior: The Okta domain input field should be displayed when configuring Okta OAuth, consistent with how the facebook and microsoft provider conditions work (lines 155 and 164, which use lowercase IDs). Fix: Changed line 174 from |
||||||||||||||||||||||||||||||||||
| <InputField | ||||||||||||||||||||||||||||||||||
| control={form.control} | ||||||||||||||||||||||||||||||||||
| name="oktaDomain" | ||||||||||||||||||||||||||||||||||
| label="Okta Domain (required if you are using Okta)" | ||||||||||||||||||||||||||||||||||
| placeholder="oktaDomain" | ||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+174
to
+181
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Case mismatch prevents Okta domain field from rendering. The condition checks Apply this diff: - {props.id === 'Okta' && (
+ {props.id === 'okta' && (
<InputField
control={form.control}
name="oktaDomain"
label="Okta Domain (required if you are using Okta)"
placeholder="oktaDomain"
/>
)}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| </> | ||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -375,7 +375,7 @@ it("returns an error when the oauth config is misconfigured", async ({ expect }) | |||||
| expect(invalidTypeResponse).toMatchInlineSnapshot(` | ||||||
| NiceResponse { | ||||||
| "status": 400, | ||||||
| "body": "auth.oauth.providers.invalid.type must be one of the following values: google, github, microsoft, spotify, facebook, discord, gitlab, bitbucket, linkedin, apple, x, twitch", | ||||||
| "body": "auth.oauth.providers.invalid.type must be one of the following values: google, github, microsoft, spotify, facebook, discord, gitlab, bitbucket, linkedin, apple, x, twitch,okta", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: missing space after comma
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/e2e/tests/backend/endpoints/api/v1/internal/config.test.ts
Line: 378:378
Comment:
**style:** missing space after comma
```suggestion
"body": "auth.oauth.providers.invalid.type must be one of the following values: google, github, microsoft, spotify, facebook, discord, gitlab, bitbucket, linkedin, apple, x, twitch, okta",
```
How can I resolve this? If you propose a fix, please make it concise.
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||||||
| "headers": Headers { <some fields may have been hidden> }, | ||||||
| } | ||||||
| `); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: missing space after colon
Prompt To Fix With AI