Skip to content

Conversation

@paskal
Copy link
Collaborator

@paskal paskal commented Feb 10, 2026

Summary

  • Add MicrosoftTenant field to provider.Params and AddMicrosoftProvider method to auth.Service
  • Allows single-tenant Entra ID (Azure AD) applications to specify their tenant instead of the hardcoded common endpoint
  • Defaults to "common" when no tenant is specified, preserving full backwards compatibility
  • Changes applied to both v1 and v2

Contributes to umputun/remark42#1998

Add MicrosoftTenant field to provider.Params and AddMicrosoftProvider
method to auth.Service, allowing single-tenant Entra ID applications
to specify their tenant instead of the hardcoded "common" endpoint.

Fixes umputun/remark42#1998
@paskal paskal marked this pull request as ready for review February 10, 2026 23:43
@paskal paskal requested a review from umputun as a code owner February 10, 2026 23:43
@coveralls
Copy link

coveralls commented Feb 10, 2026

Pull Request Test Coverage Report for Build 21887694868

Details

  • 19 of 19 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 84.247%

Totals Coverage Status
Change from base Build 21151982006: 0.6%
Covered Lines: 2706
Relevant Lines: 3212

💛 - Coveralls

paskal added a commit to umputun/remark42 that referenced this pull request Feb 10, 2026
Add AUTH_MICROSOFT_TENANT env var to allow configuring the Azure AD
tenant for single-tenant Entra ID applications, which cannot use the
default /common endpoint.

Depends on go-pkgz/auth#266

Closes #1998
paskal added a commit to umputun/remark42 that referenced this pull request Feb 10, 2026
Add AUTH_MICROSOFT_TENANT env var to allow configuring the Azure AD
tenant for single-tenant Entra ID applications, which cannot use the
default /common endpoint.

Depends on go-pkgz/auth#266

Closes #1998
@umputun
Copy link
Member

umputun commented Feb 10, 2026

clean, minimal change - does what it says. CI green, 100% coverage on changed lines, v1/v2 consistent.

two things worth considering:

  1. tenant validation - the value goes directly into microsoft.AzureADEndpoint(tenant) which concatenates it into URLs like https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize. since it's server-side config the risk is low, but basic validation (reject /, .., ?, #, whitespace) would be cheap insurance. up to you whether it's worth it.

  2. AddMicrosoftProvider + UserAttributes - the new method creates empty UserAttributes. if someone needs both custom tenant and user attributes, they'd have to construct provider.Params manually. not a blocker, just noting the gap.

otherwise LGTM

Copy link
Member

@umputun umputun left a comment

Choose a reason for hiding this comment

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

LGTM, thx for adding the validation

@umputun umputun merged commit fbba7f2 into master Feb 11, 2026
9 checks passed
@umputun umputun deleted the configurable-microsoft-tenant branch February 11, 2026 00:31
paskal added a commit to umputun/remark42 that referenced this pull request Feb 11, 2026
Add AUTH_MICROSOFT_TENANT env var to allow configuring the Azure AD
tenant for single-tenant Entra ID applications, which cannot use the
default /common endpoint.

Depends on go-pkgz/auth#266

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants