Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

fix oauth2 issues

ahmedcoder015999797574a4
diff --git a/packages/app/src/builder-ui/components/APICall.class.ts b/packages/app/src/builder-ui/components/APICall.class.ts
index 3c4bc211..df1539e7 100644
--- a/packages/app/src/builder-ui/components/APICall.class.ts
+++ b/packages/app/src/builder-ui/components/APICall.class.ts
@@ -1706,6 +1706,20 @@ export class APICall extends Component {
}
}
+ /**
+ * Checks whether a connection is a legacy component-specific connection
+ * that should be hidden from selection unless it belongs to this component.
+ * Legacy IDs follow the pattern `OAUTH_{componentId}_TOKENS`.
+ */
+ private isHiddenLegacyConnection(connectionId: string, conn: Record<string, unknown>): boolean {
+ const isLegacy = Boolean(conn?._isLegacy);
+ if (!isLegacy) {
+ return false;
+ }
+ // Only keep legacy connections whose ID contains this component's uid
+ return !connectionId.includes(this.uid);
+ }
+
// Build OAuth select options from connections with unified name detection and legacy fallback
private buildOAuthSelectOptions(
connections: Record<string, any>,
@@ -1717,6 +1731,11 @@ export class APICall extends Component {
// First pass: add ALL connections that have a name property under auth_data (new structure)
for (const [id, conn] of Object.entries(connections)) {
if (conn && typeof conn === 'object') {
+ // Skip legacy component-specific connections unless already selected
+ if (this.isHiddenLegacyConnection(id, conn as Record<string, unknown>)) {
+ continue;
+ }
+
// Check for name in the new structure: auth_settings.name
const connectionName = conn?.auth_settings?.name;
@@ -1749,27 +1768,32 @@ export class APICall extends Component {
) {
const conn = connections[componentSpecificId];
- // Check if this connection has been converted to new structure
- const hasNewStructure = conn?.auth_data && conn?.auth_settings;
-
- if (!hasNewStructure) {
- // Only add legacy connection if it hasn't been converted to new structure
- const serviceName =
- conn?.auth_settings?.oauth_info?.service ||
- conn?.oauth_info?.service ||
- conn?.auth_settings?.type ||
- conn?.type ||
- 'Unknown';
- const shortId = componentSpecificId.replace('OAUTH_', '').replace('_TOKENS', '');
-
- // Only add if not already in options (avoid duplicates)
- const alreadyExists = options.some((opt) => opt.value === componentSpecificId);
- if (!alreadyExists) {
- options.push({
- value: componentSpecificId,
- text: `${serviceName} [${shortId}]`,
- badge: createBadge('Legacy', 'text-orange-500 border-orange-500 ml-1'),
- });
+ // Skip legacy component-specific connections unless already selected
+ if (this.isHiddenLegacyConnection(componentSpecificId, conn as Record<string, unknown>)) {
+ // Do not add this legacy connection to options
+ } else {
+ // Check if this connection has been converted to new structure
+ const hasNewStructure = conn?.auth_data && conn?.auth_settings;
+
+ if (!hasNewStructure) {
+ // Only add legacy connection if it hasn't been converted to new structure
+ const serviceName =
+ conn?.auth_settings?.oauth_info?.service ||
+ conn?.oauth_info?.service ||
+ conn?.auth_settings?.type ||
+ conn?.type ||
+ 'Unknown';
+ const shortId = componentSpecificId.replace('OAUTH_', '').replace('_TOKENS', '');
+
+ // Only add if not already in options (avoid duplicates)
+ const alreadyExists = options.some((opt) => opt.value === componentSpecificId);
+ if (!alreadyExists) {
+ options.push({
+ value: componentSpecificId,
+ text: `${serviceName} [${shortId}]`,
+ badge: createBadge('Legacy', 'text-orange-500 border-orange-500 ml-1'),
+ });
+ }
}
}
}
diff --git a/packages/app/src/react/features/credentials/components/create-credentials.modal.tsx b/packages/app/src/react/features/credentials/components/create-credentials.modal.tsx
index ab3e4b50..5bb18338 100644
--- a/packages/app/src/react/features/credentials/components/create-credentials.modal.tsx
+++ b/packages/app/src/react/features/credentials/components/create-credentials.modal.tsx
@@ -486,7 +486,7 @@ export function CreateCredentialsModal({
label="Connection Name"
required
fullWidth
- placeholder="e.g., My Vector Database"
+ // placeholder="e.g
value={connectionName}
onChange={(e) => {
setConnectionName(e.target.value);
diff --git a/packages/app/src/react/features/credentials/credentials-schema.json b/packages/app/src/react/features/credentials/credentials-schema.json
index 0429d90a..10626217 100644
--- a/packages/app/src/react/features/credentials/credentials-schema.json
+++ b/packages/app/src/react/features/credentials/credentials-schema.json
@@ -1,362 +1,406 @@
[
- {
- "id": "Pinecone",
- "name": "Pinecone",
- "group": "vector_db_creds",
- "auth_type": "credentials",
- "description": "Connect to Pinecone vector database",
- "logo_url": "https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://app.pinecone.io/organizations/-NVAEezkbrqkW5cJ3zbx/projects/1a8c05fd-85bb-4266-95af-f4eb26225b0d/indexes/main/browser&size=32",
- "fields": [
- {
- "key": "apiKey",
- "label": "API Key",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Pinecone API key"
- },
- {
- "key": "indexName",
- "label": "Index Name",
- "type": "string",
- "required": true,
- "placeholder": "Enter your Pinecone index name"
- }
- ],
- "docs_url": "https://docs.pinecone.io",
- "test_endpoint": "https://api.pinecone.io/v1/health"
+ {
+ "id": "Pinecone",
+ "name": "Pinecone",
+ "group": "vector_db_creds",
+ "auth_type": "credentials",
+ "description": "Connect to Pinecone vector database",
+ "logo_url": "https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://app.pinecone.io/organizations/-NVAEezkbrqkW5cJ3zbx/projects/1a8c05fd-85bb-4266-95af-f4eb26225b0d/indexes/main/browser&size=32",
+ "fields": [
+ {
+ "key": "apiKey",
+ "label": "API Key",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Pinecone API key"
+ },
+ {
+ "key": "indexName",
+ "label": "Index Name",
+ "type": "string",
+ "required": true,
+ "placeholder": "Enter your Pinecone index name"
+ }
+ ],
+ "docs_url": "https://docs.pinecone.io",
+ "test_endpoint": "https://api.pinecone.io/v1/health"
+ },
+ {
+ "id": "Milvus",
+ "name": "Milvus",
+ "group": "vector_db_creds",
+ "auth_type": "credentials",
+ "description": "Connect to Milvus vector database",
+ "logo_url": "https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://milvus.io/docs/string.md&size=48",
+ "fields": [
+ {
+ "key": "address",
+ "label": "Address",
+ "type": "string",
+ "required": true,
+ "placeholder": "Enter your Milvus address"
+ },
+ {
+ "key": "token",
+ "label": "Token",
+ "type": "string",
+ "required": true,
+ "placeholder": "Enter your Milvus token"
+ }
+ ],
+ "docs_url": "https://milvus.io/",
+ "test_endpoint": "https://milvus.io/"
+ },
+ {
+ "id": "google",
+ "name": "Google",
+ "group": "oauth_connections_creds",
+ "auth_type": "oauth2",
+ "description": "Connect to Google services using OAuth 2.0",
+ "logo_url": "https://www.google.com/favicon.ico",
+ "docs_url": "https://developers.google.com/identity/protocols/oauth2",
+ "metadata": {
+ "callback_path": "{{BASE_URL}}/oauth/google/callback",
+ "requires_callback": true
},
- {
- "id": "Milvus",
- "name": "Milvus",
- "group": "vector_db_creds",
- "auth_type": "credentials",
- "description": "Connect to Milvus vector database",
- "logo_url": "https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://milvus.io/docs/string.md&size=48",
- "fields": [
- {
- "key": "address",
- "label": "Address",
- "type": "string",
- "required": true,
- "placeholder": "Enter your Milvus address"
- },
- {
- "key": "token",
- "label": "Token",
- "type": "string",
- "required": true,
- "placeholder": "Enter your Milvus token"
- }
- ],
- "docs_url": "https://milvus.io/",
- "test_endpoint": "https://milvus.io/"
+ "fields": [
+ {
+ "key": "authorizationURL",
+ "label": "Authorization URL",
+ "type": "string",
+ "required": true,
+ "default": "https://accounts.google.com/o/oauth2/v2/auth"
+ },
+ {
+ "key": "tokenURL",
+ "label": "Token URL",
+ "type": "url",
+ "required": true,
+ "default": "https://oauth2.googleapis.com/token"
+ },
+ {
+ "key": "clientID",
+ "label": "Client ID",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Google Client ID"
+ },
+ {
+ "key": "clientSecret",
+ "label": "Client Secret",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Google Client Secret"
+ },
+ {
+ "key": "scope",
+ "label": "Scopes",
+ "type": "textarea",
+ "required": true,
+ "default": "https://www.googleapis.com/auth/gmail.readonly",
+ "placeholder": "Space-separated list of scopes"
+ }
+ ]
+ },
+ {
+ "id": "linkedin",
+ "name": "LinkedIn",
+ "group": "oauth_connections_creds",
+ "auth_type": "oauth2",
+ "description": "Connect to LinkedIn using OAuth 2.0",
+ "logo_url": "https://www.linkedin.com/favicon.ico",
+ "docs_url": "https://docs.microsoft.com/en-us/linkedin/shared/authentication/authentication",
+ "metadata": {
+ "callback_path": "{{BASE_URL}}/oauth/linkedin/callback",
+ "requires_callback": true
},
- {
- "id": "google",
- "name": "Google",
- "group": "oauth_connections_creds",
- "auth_type": "oauth2",
- "description": "Connect to Google services using OAuth 2.0",
- "logo_url": "https://www.google.com/favicon.ico",
- "docs_url": "https://developers.google.com/identity/protocols/oauth2",
- "metadata": {
- "callback_path": "{{BASE_URL}}/oauth/google/callback",
- "requires_callback": true
+ "fields": [
+ {
+ "key": "authorizationURL",
+ "label": "Authorization URL",
+ "type": "url",
+ "required": true,
+ "default": "https://www.linkedin.com/oauth/v2/authorization"
},
- "fields": [
-
- {
- "key": "authorizationURL",
- "label": "Authorization URL",
- "type": "string",
- "required": true,
- "default": "https://accounts.google.com/o/oauth2/v2/auth"
- },
- {
- "key": "tokenURL",
- "label": "Token URL",
- "type": "url",
- "required": true,
- "default": "https://oauth2.googleapis.com/token"
- },
- {
- "key": "clientID",
- "label": "Client ID",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Google Client ID"
- },
- {
- "key": "clientSecret",
- "label": "Client Secret",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Google Client Secret"
- },
- {
- "key": "scope",
- "label": "Scopes",
- "type": "textarea",
- "required": true,
- "default": "https://www.googleapis.com/auth/gmail.readonly",
- "placeholder": "Space-separated list of scopes"
- }
- ]
+ {
+ "key": "tokenURL",
+ "label": "Token URL",
+ "type": "url",
+ "required": true,
+ "default": "https://www.linkedin.com/oauth/v2/accessToken"
+ },
+ {
+ "key": "clientID",
+ "label": "Client ID",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your LinkedIn Client ID"
+ },
+ {
+ "key": "clientSecret",
+ "label": "Client Secret",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your LinkedIn Client Secret"
+ },
+ {
+ "key": "scope",
+ "label": "Scopes",
+ "type": "textarea",
+ "required": true,
+ "default": "r_liteprofile r_emailaddress",
+ "placeholder": "Space-separated list of scopes"
+ }
+ ]
+ },
+ {
+ "id": "twitter",
+ "name": "Twitter",
+ "group": "oauth_connections_creds",
+ "auth_type": "oauth",
+ "description": "Connect to Twitter using OAuth 1.0a",
+ "logo_url": "https://twitter.com/favicon.ico",
+ "docs_url": "https://developer.twitter.com/en/docs/authentication/oauth-1-0a",
+ "metadata": {
+ "callback_path": "{{BASE_URL}}/oauth/twitter/callback",
+ "requires_callback": true
},
- {
- "id": "linkedin",
- "name": "LinkedIn",
- "group": "oauth_connections_creds",
- "auth_type": "oauth2",
- "description": "Connect to LinkedIn using OAuth 2.0",
- "logo_url": "https://www.linkedin.com/favicon.ico",
- "docs_url": "https://docs.microsoft.com/en-us/linkedin/shared/authentication/authentication",
- "metadata": {
- "callback_path": "{{BASE_URL}}/oauth/linkedin/callback",
- "requires_callback": true
+ "fields": [
+ {
+ "key": "requestTokenURL",
+ "label": "Request Token URL",
+ "type": "url",
+ "required": true,
+ "default": "https://api.twitter.com/oauth/request_token"
+ },
+ {
+ "key": "accessTokenURL",
+ "label": "Access Token URL",
+ "type": "url",
+ "required": true,
+ "default": "https://api.twitter.com/oauth/access_token"
+ },
+ {
+ "key": "userAuthorizationURL",
+ "label": "User Authorization URL",
+ "type": "url",
+ "required": true,
+ "default": "https://api.twitter.com/oauth/authorize"
+ },
+ {
+ "key": "consumerKey",
+ "label": "Consumer Key",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Twitter Consumer Key"
},
- "fields": [
-
-
- {
- "key": "authorizationURL",
- "label": "Authorization URL",
- "type": "url",
- "required": true,
- "default": "https://www.linkedin.com/oauth/v2/authorization"
- },
- {
- "key": "tokenURL",
- "label": "Token URL",
- "type": "url",
- "required": true,
- "default": "https://www.linkedin.com/oauth/v2/accessToken"
- },
- {
- "key": "clientID",
- "label": "Client ID",
- "type": "password",
- "required": true,
- "placeholder": "Enter your LinkedIn Client ID"
- },
- {
- "key": "clientSecret",
- "label": "Client Secret",
- "type": "password",
- "required": true,
- "placeholder": "Enter your LinkedIn Client Secret"
- },
- {
- "key": "scope",
- "label": "Scopes",
- "type": "textarea",
- "required": true,
- "default": "r_liteprofile r_emailaddress",
- "placeholder": "Space-separated list of scopes"
- }
- ]
+ {
+ "key": "consumerSecret",
+ "label": "Consumer Secret",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Twitter Consumer Secret"
+ }
+ ]
+ },
+ {
+ "id": "custom_oauth2",
+ "name": "Custom OAuth2.0",
+ "group": "oauth_connections_creds",
+ "auth_type": "oauth2",
+ "description": "Connect to any service using custom OAuth 2.0 configuration",
+ "logo_url": null,
+ "docs_url": "https://oauth.net/2/",
+ "metadata": {
+ "callback_path": "{{BASE_URL}}/oauth/oauth2/callback",
+ "requires_callback": true
},
- {
- "id": "twitter",
- "name": "Twitter",
- "group": "oauth_connections_creds",
- "auth_type": "oauth",
- "description": "Connect to Twitter using OAuth 1.0a",
- "logo_url": "https://twitter.com/favicon.ico",
- "docs_url": "https://developer.twitter.com/en/docs/authentication/oauth-1-0a",
- "metadata": {
- "callback_path": "{{BASE_URL}}/oauth/twitter/callback",
- "requires_callback": true
+ "fields": [
+ {
+ "key": "authorizationURL",
+ "label": "Authorization URL",
+ "type": "url",
+ "required": true,
+ "placeholder": "https://provider.com/oauth/authorize"
},
- "fields": [
-
- {
- "key": "requestTokenURL",
- "label": "Request Token URL",
- "type": "url",
- "required": true,
- "default": "https://api.twitter.com/oauth/request_token"
- },
- {
- "key": "accessTokenURL",
- "label": "Access Token URL",
- "type": "url",
- "required": true,
- "default": "https://api.twitter.com/oauth/access_token"
- },
- {
- "key": "userAuthorizationURL",
- "label": "User Authorization URL",
- "type": "url",
- "required": true,
- "default": "https://api.twitter.com/oauth/authorize"
- },
- {
- "key": "consumerKey",
- "label": "Consumer Key",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Twitter Consumer Key"
- },
- {
- "key": "consumerSecret",
- "label": "Consumer Secret",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Twitter Consumer Secret"
- }
- ]
+ {
+ "key": "tokenURL",
+ "label": "Token URL",
+ "type": "url",
+ "required": true,
+ "placeholder": "https://provider.com/oauth/token"
+ },
+ {
+ "key": "clientID",
+ "label": "Client ID",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Client ID"
+ },
+ {
+ "key": "clientSecret",
+ "label": "Client Secret",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Client Secret"
+ },
+ {
+ "key": "scope",
+ "label": "Scopes",
+ "type": "textarea",
+ "required": true,
+ "placeholder": "Space-separated list of scopes"
+ }
+ ]
+ },
+ {
+ "id": "oauth2",
+ "name": "Custom OAuth2.0",
+ "group": "oauth_connections_creds",
+ "auth_type": "oauth2",
+ "description": "Connect to any service using custom OAuth 2.0 configuration",
+ "logo_url": null,
+ "docs_url": "https://oauth.net/2/",
+ "metadata": {
+ "callback_path": "{{BASE_URL}}/oauth/oauth2/callback",
+ "requires_callback": true
},
- {
- "id": "custom_oauth2",
- "name": "Custom OAuth2.0",
- "group": "oauth_connections_creds",
- "auth_type": "oauth2",
- "description": "Connect to any service using custom OAuth 2.0 configuration",
- "logo_url": null,
- "docs_url": "https://oauth.net/2/",
- "metadata": {
- "callback_path": "{{BASE_URL}}/oauth/oauth2/callback",
- "requires_callback": true
+ "fields": [
+ {
+ "key": "authorizationURL",
+ "label": "Authorization URL",
+ "type": "url",
+ "required": true,
+ "placeholder": "https://provider.com/oauth/authorize"
+ },
+ {
+ "key": "tokenURL",
+ "label": "Token URL",
+ "type": "url",
+ "required": true,
+ "placeholder": "https://provider.com/oauth/token"
+ },
+ {
+ "key": "clientID",
+ "label": "Client ID",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Client ID"
+ },
+ {
+ "key": "clientSecret",
+ "label": "Client Secret",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Client Secret"
},
- "fields": [
-
- {
- "key": "authorizationURL",
- "label": "Authorization URL",
- "type": "url",
- "required": true,
- "placeholder": "https://provider.com/oauth/authorize"
- },
- {
- "key": "tokenURL",
- "label": "Token URL",
- "type": "url",
- "required": true,
- "placeholder": "https://provider.com/oauth/token"
- },
- {
- "key": "clientID",
- "label": "Client ID",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Client ID"
- },
- {
- "key": "clientSecret",
- "label": "Client Secret",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Client Secret"
- },
- {
- "key": "scope",
- "label": "Scopes",
- "type": "textarea",
- "required": true,
- "placeholder": "Space-separated list of scopes"
- }
- ]
+ {
+ "key": "scope",
+ "label": "Scopes",
+ "type": "textarea",
+ "required": true,
+ "placeholder": "Space-separated list of scopes"
+ }
+ ]
+ },
+ {
+ "id": "custom_oauth1",
+ "name": "Custom OAuth1.0",
+ "group": "oauth_connections_creds",
+ "auth_type": "oauth",
+ "description": "Connect to any service using custom OAuth 1.0a configuration",
+ "logo_url": null,
+ "docs_url": "https://oauth.net/core/1.0a/",
+ "metadata": {
+ "callback_path": "{{BASE_URL}}/oauth/oauth1/callback",
+ "requires_callback": true
},
- {
- "id": "custom_oauth1",
- "name": "Custom OAuth1.0",
- "group": "oauth_connections_creds",
- "auth_type": "oauth",
- "description": "Connect to any service using custom OAuth 1.0a configuration",
- "logo_url": null,
- "docs_url": "https://oauth.net/core/1.0a/",
- "metadata": {
- "callback_path": "{{BASE_URL}}/oauth/oauth1/callback",
- "requires_callback": true
+ "fields": [
+ {
+ "key": "requestTokenURL",
+ "label": "Request Token URL",
+ "type": "url",
+ "required": true,
+ "placeholder": "https://provider.com/oauth/request_token"
},
- "fields": [
- {
- "key": "requestTokenURL",
- "label": "Request Token URL",
- "type": "url",
- "required": true,
- "placeholder": "https://provider.com/oauth/request_token"
- },
- {
- "key": "accessTokenURL",
- "label": "Access Token URL",
- "type": "url",
- "required": true,
- "placeholder": "https://provider.com/oauth/access_token"
- },
- {
- "key": "userAuthorizationURL",
- "label": "User Authorization URL",
- "type": "url",
- "required": true,
- "placeholder": "https://provider.com/oauth/authorize"
- },
- {
- "key": "consumerKey",
- "label": "Consumer Key",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Consumer Key"
- },
- {
- "key": "consumerSecret",
- "label": "Consumer Secret",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Consumer Secret"
- }
- ]
+ {
+ "key": "accessTokenURL",
+ "label": "Access Token URL",
+ "type": "url",
+ "required": true,
+ "placeholder": "https://provider.com/oauth/access_token"
+ },
+ {
+ "key": "userAuthorizationURL",
+ "label": "User Authorization URL",
+ "type": "url",
+ "required": true,
+ "placeholder": "https://provider.com/oauth/authorize"
+ },
+ {
+ "key": "consumerKey",
+ "label": "Consumer Key",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Consumer Key"
+ },
+ {
+ "key": "consumerSecret",
+ "label": "Consumer Secret",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Consumer Secret"
+ }
+ ]
+ },
+ {
+ "id": "oauth2_client_credentials",
+ "name": "OAuth2 Client Credentials",
+ "group": "oauth_connections_creds",
+ "auth_type": "oauth2_client_credentials",
+ "description": "Connect using OAuth 2.0 Client Credentials flow (server-to-server)",
+ "logo_url": null,
+ "docs_url": "https://oauth.net/2/grant-types/client-credentials/",
+ "metadata": {
+ "callback_path": "{{BASE_URL}}/oauth/oauth2/callback",
+ "requires_callback": false
},
- {
- "id": "oauth2_client_credentials",
- "name": "OAuth2 Client Credentials",
- "group": "oauth_connections_creds",
- "auth_type": "oauth2_client_credentials",
- "description": "Connect using OAuth 2.0 Client Credentials flow (server-to-server)",
- "logo_url": null,
- "docs_url": "https://oauth.net/2/grant-types/client-credentials/",
- "metadata": {
- "callback_path": "{{BASE_URL}}/oauth/oauth2/callback",
- "requires_callback": false
+ "fields": [
+ {
+ "key": "tokenURL",
+ "label": "Token URL",
+ "type": "url",
+ "required": true,
+ "placeholder": "https://provider.com/oauth/token"
+ },
+ {
+ "key": "clientID",
+ "label": "Client ID",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Client ID"
+ },
+ {
+ "key": "clientSecret",
+ "label": "Client Secret",
+ "type": "password",
+ "required": true,
+ "placeholder": "Enter your Client Secret"
+ },
+ {
+ "key": "scope",
+ "label": "Scopes",
+ "type": "textarea",
+ "required": false,
+ "placeholder": "Space-separated list of scopes (optional)"
},
- "fields": [
-
- {
- "key": "tokenURL",
- "label": "Token URL",
- "type": "url",
- "required": true,
- "placeholder": "https://provider.com/oauth/token"
- },
- {
- "key": "clientID",
- "label": "Client ID",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Client ID"
- },
- {
- "key": "clientSecret",
- "label": "Client Secret",
- "type": "password",
- "required": true,
- "placeholder": "Enter your Client Secret"
- },
- {
- "key": "scope",
- "label": "Scopes",
- "type": "textarea",
- "required": false,
- "placeholder": "Space-separated list of scopes (optional)"
- },
- {
- "key": "audience",
- "label": "Audience",
- "type": "string",
- "required": false,
- "placeholder": "Audience URL"
- }
- ]
- }
- ]
+ {
+ "key": "audience",
+ "label": "Audience",
+ "type": "string",
+ "required": false,
+ "placeholder": "Audience URL"
+ }
+ ]
+ }
+]
diff --git a/packages/app/src/shared/helpers/oauth/oauth-api.helper.ts b/packages/app/src/shared/helpers/oauth/oauth-api.helper.ts
index f00b2c9e..332b47ba 100644
--- a/packages/app/src/shared/helpers/oauth/oauth-api.helper.ts
+++ b/packages/app/src/shared/helpers/oauth/oauth-api.helper.ts
@@ -50,8 +50,7 @@ export function getConnectionOauthInfo(connection: any, connectionId?: string):
// Ensure oauth_keys_prefix is set
if (!reconstructed.oauth_keys_prefix && connectionId) {
// reconstructed.oauth_keys_prefix = connectionId.replace('_TOKENS', '');
- reconstructed.oauth_keys_prefix = connectionId
-
+ reconstructed.oauth_keys_prefix = connectionId;
}
return Object.keys(reconstructed).length > 0 ? reconstructed : null;
@@ -508,6 +507,12 @@ export function transformOAuthCredEntry(
service: credentialEntry.provider,
platform: credentialEntry.name,
},
+
+ ...(credentialEntry.customProperties?._isLegacy
+ ? {
+ _isLegacy: true,
+ }
+ : {}),
};
}
@@ -524,5 +529,11 @@ export function transformOAuthCredEntry(
platform: credentialEntry.name,
...credentialEntry.credentials,
},
+
+ ...(credentialEntry.customProperties?._isLegacy
+ ? {
+ _isLegacy: true,
+ }
+ : {}),
};
}