Skip to content

Conversation

@Actu4l-Human
Copy link

Summary

This change adds support for a custom Company Portal URL (e.g. GCC High / sovereign cloud endpoints) and hardens the Intune MDM detection logic so it correctly identifies Intune across all manage.microsoft.* domains while avoiding obvious false positives.

Changes

Configurable Company Portal URL

Introduces a new optional configuration key: CompanyPortalUrl.

If set, the Company Portal view now loads this URL instead of a hard-coded commercial endpoint.

If not set, the existing behavior is preserved by falling back to the default commercial Intune Company Portal URL.

This enables environments such as GCC High to point the Company Portal tab at https://portal.manage.microsoft.us/ (or other valid Microsoft endpoints) via MDM configuration, without requiring a custom build.

Improved Intune detection for MDM URL

Replaces the previous substring check on mdmUrl.contains(".manage.microsoft.") with host-based detection.

The MDM URL is now parsed via URL(string:), and detection is performed on the host only.

A stricter pattern is used to match manage.microsoft. and subdomains of it, preventing matches against hosts like evil.manage.microsoft.notmicrosoft.com.

This allows Intune mode to be correctly selected for any manage.microsoft.* TLD (e.g. commercial, GCC High, and other Microsoft clouds), while reducing the chance of misclassification.

@almenscorner
Copy link
Collaborator

Hi,

Thank you for this, can you change the base to the dev branch instead of main so it can be included in a preview version?

@Actu4l-Human Actu4l-Human changed the base branch from main to dev November 28, 2025 18:44
@Actu4l-Human
Copy link
Author

Sorry about that, just changed it to dev.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants