Skip to content

Feature/167 groups from ldap for entra#168

Merged
dk1844 merged 10 commits into
masterfrom
feature/167-groups-from-ldap-for-entra
May 15, 2026
Merged

Feature/167 groups from ldap for entra#168
dk1844 merged 10 commits into
masterfrom
feature/167-groups-from-ldap-for-entra

Conversation

@dk1844
Copy link
Copy Markdown
Collaborator

@dk1844 dk1844 commented May 14, 2026

This PR introduces a new feature described in #167.

With loginsvc.rest.jwt.{aws-secrets-manager|generate-in-memory}.allow-providers-to-refresh-groups-on-generate = false, the token without groups (typically coming from MS Entra) may be enriched by groups coming from a UserSearchService (typically LDAP, but ConfigUsers would work, too).

Necessary changes added:

  • groups filtering has moved to JWTService from TokenController (because we need to filter the fetched groups, too)
  • supported by new unit tests
  • UI of the login form extended to optionally support groups-prefixes (vibe-coded 😆)

Release notes:

  • config now must contain ``loginsvc.rest.jwt.{aws-secrets-manager|generate-in-memory}.allow-providers-to-refresh-groups-on-generate = false|true`. If enabled, this bring the ability to fill empty groups for users (obtained by MS Entra).

Developer testing

Login form UI result with custom groups-prefixes used via MS Entra:
(backend setup includes allow-providers-to-refresh-groups-on-generate = false, but empty groups were fetched in the MS Entra JWT)
image
Resulting LS access token contains groups now fetched from LDAP based on the sub in the MS Entra JWT:
image

Closes #167

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Report: Report: api - scala:2.12.17

Metric (instruction) Coverage Threshold Status
Overall 71.68% 43.0%
Changed Files 91.34% 70.0%
File Path Coverage Threshold Status
AwsSecretsManagerKeyConfig.scala 92.18% 0.0%
InMemoryKeyConfig.scala 98.0% 0.0%
JWTService.scala 82.52% 0.0%
KeyConfig.scala 91.48% 0.0%
PrefixesConfig.scala 94.25% 0.0%
TokenController.scala 80.95% 0.0%
User.scala 100.0% 0.0%

val prefixes = prefixesStr.trim.split(',')
user.filterGroupsByPrefixes(prefixes.toSet, caseSensitive)
}
// groups filtering is pushed down to JWTService as it may be needed for entra-users without groups to have groups added and filtered in the same way
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the get-experimental endpoint.
The fate of it is not decided yet, therefore no generalization effort with the normal post-based token/generate (identical impl now).

This feature is disabled on PROD.

@dk1844 dk1844 marked this pull request as ready for review May 14, 2026 08:15
@dk1844 dk1844 requested a review from jakipatryk as a code owner May 14, 2026 08:15
Copy link
Copy Markdown
Collaborator

@TheLydonKing TheLydonKing left a comment

Choose a reason for hiding this comment

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

LGTM.

@dk1844 dk1844 merged commit 5e7c61b into master May 15, 2026
5 of 6 checks passed
@dk1844 dk1844 deleted the feature/167-groups-from-ldap-for-entra branch May 15, 2026 07:37
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.

Allow groups slipstream in token/generate (e.g. for MSEntra)

2 participants