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

[ES-2250] preferring consent_expire_in_mins field over accessTokenExpireSeconds/idTokenExpireSeconds #1219

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

sacrana0
Copy link
Contributor

@sacrana0 sacrana0 commented Mar 7, 2025

If consent_expire_in_mins is provided in additional_config during client creation it will override the accessTokenExpireSecods and idtokenExpireSeconds configuration.

… and idTokenExpireSeconds configuration

Signed-off-by: Sachin Rana <sacrana324@gmail.com>
Signed-off-by: Sachin Rana <sacrana324@gmail.com>
TokenResponse tokenResponse = getTokenResponse(transaction, isTransactionVCScoped);
Optional<Integer> consentExpireSeconds = Optional.empty();
JsonNode additionalConfig = clientDetailDto.getAdditionalConfig();
if(additionalConfig != null && additionalConfig.get("consent_expire_in_mins") != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

in a recent PR, We have added a method in clientDetailDTo to fetch the value of a particular additionalConfig and return the default value if the entry is not present. Can we use the same method here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I will check that

Optional<Integer> consentExpireSeconds = Optional.empty();
JsonNode additionalConfig = clientDetailDto.getAdditionalConfig();
if(additionalConfig != null && additionalConfig.get("consent_expire_in_mins") != null) {
consentExpireSeconds = Optional.of(additionalConfig.get("consent_expire_in_mins").intValue()*60);
Copy link
Contributor

Choose a reason for hiding this comment

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

Create a constant for "consent_expire_in_mins" instead of defining the string everywhere.

Signed-off-by: Sachin Rana <sacrana324@gmail.com>
Signed-off-by: Sachin Rana <sacrana324@gmail.com>
Signed-off-by: Sachin Rana <sacrana324@gmail.com>
Signed-off-by: Sachin Rana <sacrana324@gmail.com>
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