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

feat(jans-auth-server): allow to use openidSubAttribute for localAccountId for pairwise identifier look up #9696 #10269

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

yuriyz
Copy link
Contributor

@yuriyz yuriyz commented Nov 26, 2024

Description

feat(jans-auth-server): allow to use openidSubAttribute for localAccountId for pairwise identifier look up

Target issue

closes #9696

Test and Document the changes

  • Static code analysis has been run locally and issues have been fixed

Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with docs: to indicate documentation changes or if the below checklist is not selected.

  • I confirm that there is no impact on the docs due to the code changes in this PR.

…untId for pairwise identifier look up #9696

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>
@yuriyz yuriyz requested review from yurem and yuriyzz as code owners November 26, 2024 09:24
Copy link

dryrunsecurity bot commented Nov 26, 2024

DryRun Security Summary

The provided code changes focus on improving the handling of the OpenID Connect (OIDC) sub claim and the management of pairwise identifiers within the jans-auth-server project, enhancing the application's security and compliance with OIDC standards.

Expand for full summary

Summary:

The provided code changes are focused on improving the handling of the OpenID Connect (OIDC) sub claim and the management of pairwise identifiers within the jans-auth-server project. These changes are important for maintaining the privacy and security of user identities in the OIDC implementation.

The key changes include the addition of a new getOpenidSubValue method to determine the appropriate value for the sub claim, modifications to the existing getSub method to use the new getOpenidSubValue function, and the introduction of a new configuration parameter useOpenidSubAttributeValueForPairwiseLocalAccountId to allow using the sub attribute value as the local account ID for algorithmic pairwise lookup.

Additionally, the changes to the PairwiseIdentifierService class ensure that pairwise identifiers are properly managed, with support for both persistent and algorithmic pairwise identifiers. The use of a key and salt for algorithmic pairwise identifiers, as well as the option to use the OpenID sub attribute value, are security-conscious features that help protect user privacy.

Overall, the code changes in this pull request appear to be focused on enhancing the application's security and compliance with OIDC standards, which is a positive sign for the project's security posture.

Files Changed:

  1. jans-auth-server/server/src/main/java/io/jans/as/server/service/SectorIdentifierService.java:

    • Added a new getOpenidSubValue method to determine the appropriate value for the sub claim.
    • Updated the existing getSub method to call the new getOpenidSubValue method.
  2. jans-auth-server/model/src/main/java/io/jans/as/model/configuration/AppConfiguration.java:

    • Added a new configuration parameter useOpenidSubAttributeValueForPairwiseLocalAccountId to specify whether the OpenID sub attribute value should be used as the local account ID for algorithmic pairwise lookup.
  3. jans-auth-server/server/src/main/java/io/jans/as/server/service/PairwiseIdentifierService.java:

    • Implemented the logic for managing persistent and algorithmic pairwise identifiers.
    • Ensured that pairwise identifiers are unique for a given user, sector identifier, and client ID (or shared across clients with the same sector identifier, if configured).
    • Utilized a key and salt for algorithmic pairwise identifiers to prevent predictability and make it harder for an attacker to guess the identifiers.
    • Provided the option to use the OpenID sub attribute value for the pairwise identifier to improve user privacy.

Code Analysis

We ran 9 analyzers against 3 files and 0 analyzers had findings. 9 analyzers had no findings.

Riskiness

🟢 Risk threshold not exceeded.

View PR in the DryRun Dashboard.

@yuriyz yuriyz enabled auto-merge (squash) November 26, 2024 09:25
@mo-auto mo-auto added comp-jans-auth-server Component affected by issue or PR kind-feature Issue or PR is a new feature request labels Nov 26, 2024
@yuriyz yuriyz merged commit 5d72a06 into main Nov 26, 2024
11 checks passed
@yuriyz yuriyz deleted the jans-auth-server-9696 branch November 26, 2024 09:27
Copy link

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-auth-server Component affected by issue or PR kind-feature Issue or PR is a new feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(jans-auth-server): allow to use openidSubAttribute for localAccountId for pairwise identifier creation
4 participants