From e774ed2e481ed9aaa77fb277a7905200bb8fe2e3 Mon Sep 17 00:00:00 2001 From: MHMD <45968454+dou-mhmd@users.noreply.github.com> Date: Mon, 31 Aug 2026 14:35:22 +0000 Subject: [PATCH] feat(core): Add chat-specific branding to the shared OAuth consent screen (#37430) --- .../chat-trigger-resource.base.ts | 3 ++- .../oauth-server/protected-resource-resolvers/utils.ts | 6 ++++++ packages/frontend/@n8n/i18n/src/locales/en.json | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.ts b/packages/cli/src/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.ts index 4eabf775403..40e7166200a 100644 --- a/packages/cli/src/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.ts +++ b/packages/cli/src/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.ts @@ -12,6 +12,7 @@ import type { WorkflowFinderService } from '@/workflows/workflow-finder.service' import { triggerResourceGate } from '../resource-gate'; import { + CHAT_TRIGGER_CONSENT_HINTS, CHAT_TRIGGER_SCOPES, isOAuthProtectedChatTrigger, resourceUrlToWebhookPath, @@ -113,7 +114,7 @@ export abstract class ChatTriggerResourceResolverBase implements ProtectedResour getAllowedRedirectUris: async () => [resourceUrl], scopes: CHAT_TRIGGER_SCOPES, displayName: workflowName, - // `uiHints` is IAM-1266's. + uiHints: CHAT_TRIGGER_CONSENT_HINTS, ...triggerResourceGate(this.workflowFinderService, { audiences, executeAccessWorkflowId: requireExecute ? workflowId : undefined, diff --git a/packages/cli/src/modules/oauth-server/protected-resource-resolvers/utils.ts b/packages/cli/src/modules/oauth-server/protected-resource-resolvers/utils.ts index 617dc7beece..5754ce81a69 100644 --- a/packages/cli/src/modules/oauth-server/protected-resource-resolvers/utils.ts +++ b/packages/cli/src/modules/oauth-server/protected-resource-resolvers/utils.ts @@ -24,6 +24,12 @@ export const WEBHOOK_TRIGGER_SCOPES: string[] = []; /** Scopes advertised for per-workflow Chat trigger resources. Empty, like the other triggers. */ export const CHAT_TRIGGER_SCOPES: string[] = []; +/** Consent-screen presentation hints for per-workflow Chat trigger resources. */ +export const CHAT_TRIGGER_CONSENT_HINTS: ConsentUiHints = { + icon: 'node:chat-trigger', + consentType: 'chat', +}; + /** * A chat trigger is an OAuth protected resource only in the shape the hosted page can actually * serve: enabled, published publicly, on the n8n-hosted page rather than the embedded widget, and diff --git a/packages/frontend/@n8n/i18n/src/locales/en.json b/packages/frontend/@n8n/i18n/src/locales/en.json index 23867c0ad85..b6a5fd5b72f 100644 --- a/packages/frontend/@n8n/i18n/src/locales/en.json +++ b/packages/frontend/@n8n/i18n/src/locales/en.json @@ -2644,6 +2644,7 @@ "oauth.consentView.firstParty.heading": "\"{resourceName}\" wants to run using your n8n login", "oauth.consentView.firstParty.description": "Running this {resourceType} executes its workflow using your account and any connected credentials. Only continue if you trust the creator of this {resourceType}.", "oauth.consentView.firstParty.type.form": "form", + "oauth.consentView.firstParty.type.chat": "chatbot", "oauth.consentView.firstParty.type.default": "resource", "oauth.consentView.allowDisabled.trust": "First confirm you recognize and trust the URL above", "oauth.consentView.allowDisabled.noScopes": "Select at least one scope to grant",