Skip to content

feat(webapp): add Active Directory web client#1849

Draft
Krista House (kristahouse) wants to merge 2 commits into
masterfrom
kristahouse-active-directory-pr-2
Draft

feat(webapp): add Active Directory web client#1849
Krista House (kristahouse) wants to merge 2 commits into
masterfrom
kristahouse-active-directory-pr-2

Conversation

@kristahouse

Copy link
Copy Markdown
Contributor

Adds Active Directory support to the standalone Gateway web client, allowing users to open LDAP and LDAPS sessions from the Gateway UI.

The new experience includes an Active Directory connection form, session tab handling, LDAP-backed data operations, and theme-aligned Active Directory UI integration using the published Active Directory web component package.

Issue: N/A

Adds Active Directory web-client support for LDAP and LDAPS sessions, including the connection form, session lifecycle integration, LDAP WASM data adapter, and WebTerminal Active Directory composite wiring.

Integrates the Active Directory UI with the Gateway theme using scoped bridge tokens and the published Active Directory GUI package.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 10, 2026 18:04
@kristahouse

Copy link
Copy Markdown
Contributor Author

Implementation notes:

  • Adds Protocol.ActiveDirectory and wires the AD form, connection params, tab/session model, and LDAP/LDAPS Gateway token generation.
  • Bridges Gateway to @devolutions/web-active-directory-gui@0.0.13 and @devolutions/ldap-wasm-js through component-scoped data, session, store, UI, and translator adapters.
  • Keeps AD visual integration scoped through ad-theme-bridge.gateway.scss and the AD host, including member-management icon color mapping to the same row-action token used by edit/context icons.
  • Retains the scoped AD toast override because Gateway's global toast styles hide summaries, while AD needs summary plus LDAP detail.
  • Uses package-owned PrimeNG 20 compatibility from the published AD GUI package; the old Gateway patch is no longer needed.
  • Validated with pnpm --filter gateway-ui build, pnpm --filter gateway-ui lint, and browser smoke testing of the AD UI.

@github-actions

Copy link
Copy Markdown

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an Active Directory (LDAP/LDAPS) web client experience to the standalone Gateway UI, integrating Devolutions’ published AD web component and wiring it into the existing web-client session/tab architecture.

Changes:

  • Introduces a new Active Directory web-client session component (token fetch, WASM LDAP initialization, connect/error handling, tab icon updates).
  • Adds an Active Directory connection form (domain override, port, LDAPS toggle, OU) and integrates it into the existing connect flow.
  • Updates webapp dependencies/styles to include the AD UI package, LDAP WASM package, and theme bridging.

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
webapp/pnpm-lock.yaml Adds lockfile entries for AD/LDAP packages and updates PrimeUIX versions.
webapp/apps/gateway-ui/src/client/app/styles/ad-theme-bridge.gateway.scss Introduces CSS variable bridging to align AD component theming with Gateway themes.
webapp/apps/gateway-ui/src/client/app/shared/services/web-client.service.ts Adds AD token generation support and protocol mapping (ldap/ldaps).
webapp/apps/gateway-ui/src/client/app/shared/models/web-session.model.ts Extends session type mappings to include the AD web-client component and form input type.
webapp/apps/gateway-ui/src/client/app/shared/interfaces/forms.interfaces.ts Adds ActiveDirectoryFormDataInput and includes it in the form union.
webapp/apps/gateway-ui/src/client/app/shared/interfaces/connection-params.interfaces.ts Adds ActiveDirectoryConnectionParameters and a type guard helper.
webapp/apps/gateway-ui/src/client/app/shared/enums/web-client-protocol.enum.ts Adds Protocol.ActiveDirectory, label mapping, and protocol helper.
webapp/apps/gateway-ui/src/client/app/modules/web-client/web-client.module.ts Registers the AD web component and new Gateway AD session/form components.
webapp/apps/gateway-ui/src/client/app/modules/web-client/form/web-client-form.component.ts Adds AD-specific hostname labeling and protocol selection helper.
webapp/apps/gateway-ui/src/client/app/modules/web-client/form/web-client-form.component.html Renders the AD-specific form when the AD protocol is selected and updates hostname label rendering.
webapp/apps/gateway-ui/src/client/app/modules/web-client/form/form-components/active-directory/active-directory-form.component.ts New AD form component adding port/LDAPS/OU controls and validators.
webapp/apps/gateway-ui/src/client/app/modules/web-client/form/form-components/active-directory/active-directory-form.component.html New AD form UI (domain override, port validation message, LDAPS checkbox, OU input).
webapp/apps/gateway-ui/src/client/app/modules/web-client/form/form-components/active-directory/active-directory-form.component.scss Styling for the AD form layout.
webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/web-client-active-directory.component.ts New AD session component: token flow, WASM init, connect, event handling, session metadata.
webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/web-client-active-directory.component.html Hosts <web-active-directory> and PrimeNG confirm/toast surfaces.
webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/web-client-active-directory.component.scss Styles toast/host layout for the AD session UI.
webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/services/active-directory-ui.service.ts PrimeNG-backed UI adapter (toast/confirm/loading cursor) for the AD component.
webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/services/active-directory-translator.service.ts Translator implementation and translation table for the AD component.
webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/services/active-directory-session-store.service.ts In-memory LDAP session storage for the AD data provider.
webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/services/active-directory-session-manager.service.ts In-memory AD web session config manager (per sessionId).
webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/services/active-directory-data.service.ts LDAP WASM-backed data provider implementation (connect/bind/search/modify/add/delete, paging).
webapp/apps/gateway-ui/src/client/app/app.constants.ts Adds AD protocol icon constant, AD jet path constant, and protocol name mappings for ldap/ldaps.
webapp/apps/gateway-ui/src/assets/css/main.scss Includes AD component styles and adds an icon-font override for PrimeIcons.
webapp/apps/gateway-ui/package.json Adds AD/LDAP packages and updates PrimeUIX theme/util versions.
Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webapp/apps/gateway-ui/src/client/app/shared/services/web-client.service.ts Outdated
Comment thread webapp/apps/gateway-ui/src/client/app/app.constants.ts Outdated
Redact invalid Active Directory connection logging, guard the AD port template control, use the LDAPS default port when needed, validate required AD connection parameters, and use the installed Active Directory icon class.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 8 comments.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

Comment on lines +34 to +35
ldap: Protocol.ActiveDirectory,
ldaps: Protocol.ActiveDirectory,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed locally, not pushed yet per request: NetScanEntry now preserves the scanned service protocol (ldap vs ldaps), and the form selection initializes AD useLdaps plus the default port (389/636) from that scanned transport.

this.webClientConnectionClosed();
}

this.activeDirectorySessionManager.clearWebSessionConfig(this.webSessionId);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed locally, not pushed yet per request: the component now retains the generated forwarding session ID and clears the AD session config with that key during teardown instead of using the unrelated web session ID.

Comment on lines +6 to +7
const AD_CONFIRM_KEY = 'adc-confirm-dialog';
const AD_TOAST_KEY = 'adc-toast';
Comment on lines +30 to +32
clearToast(key?: string): void {
this.messageService.clear(key);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed locally, not pushed yet per request: clearToast() now defaults to the AD toast key instead of passing undefined through to the shared PrimeNG message service.

Comment on lines +48 to +50
showLoading(): void {
this.loadingCount++;
document.body.style.cursor = 'wait';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed locally, not pushed yet per request: AD loading cursor state is now coordinated with a static/global count, preserves the prior body cursor, and releases any outstanding count from ngOnDestroy.

Comment on lines +433 to +438
const parts = serverComputerName.split('.');

return {
domain: parts.length > 1 ? parts.slice(1).join('.') : undefined,
serverComputerName,
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed locally, not pushed yet per request: domain inference now detects IP literals and avoids deriving an authentication domain from dotted IPv4 addresses.

Comment on lines +124 to +131
sendTerminateSessionCmd(): void {
if (!this.activeDirectoryHandle || !this.currentStatus.isInitialized) {
return;
}

this.currentStatus.isInitialized = false;
this.activeDirectoryHandle.close();
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed locally, not pushed yet per request: termination now closes an existing AD handle even while setup is still in progress, so closing a tab cannot leave the forward connection running before initialization completes.

Comment on lines +426 to +430
if (domain) {
return {
domain,
serverComputerName: `${serverComputerName.replace(`.${domain}`, '')}.${domain}`,
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed locally, not pushed yet per request: domain/server-name resolution now keeps already-qualified hosts unchanged and only appends DNS suffix-style overrides to single-label hostnames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants