Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#60 displayname added to JWT #61

Merged
merged 3 commits into from
Aug 21, 2023
Merged

#60 displayname added to JWT #61

merged 3 commits into from
Aug 21, 2023

Conversation

dk1844
Copy link
Collaborator

@dk1844 dk1844 commented Aug 18, 2023

The user token now optionally contains field displayname for a friendly name string. This either comes from LDAP's displayname field or from user config (also displayname field).

Some unit tests added/adjusted.

FYI @fateeand

Example - config-based:

With config of

            - username: "TestUser"
              password: "password123"
              displayname: "Test User MD"
              email: "[email protected]"
              groups:
                - "groupA"
                - "groupB"

the token contains this information:

{
  "sub": "TestUser",
  "exp": 1692365356,
  "iat": 1692350956,
  "groups": [
    "groupA",
    "groupB"
  ],
  "email": "[email protected]",
  "displayname": "Test User MD"
}

Example - LDAP-based:

.. tested against company LDAP

{
  ...,
  "displayname": "Daniel Kavan (CZ)"
}

@github-actions
Copy link

github-actions bot commented Aug 18, 2023

JaCoCo code coverage report - scala:2.12.17

File Coverage [58.07%]
OptionExt.scala 100% 🍏
User.scala 100% 🍏
JWTService.scala 83.51% 🍏
ConfigUsersAuthenticationProvider.scala 74.19%
UsersConfig.scala 71.92%
ActiveDirectoryLDAPAuthenticationProvider.scala 18.6%
Total Project Coverage 74.87% 🍏

Copy link
Collaborator

@jakipatryk jakipatryk left a comment

Choose a reason for hiding this comment

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

LGTM, checked code, ran locally with config users and AD users (normal and service account).

@dk1844 dk1844 merged commit 828ee98 into master Aug 21, 2023
2 of 3 checks passed
@dk1844 dk1844 deleted the feature/60-friendlyname branch August 21, 2023 14:17
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.

2 participants