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

Made keycloak client configurable using the Spring security audience value #67

Merged
merged 2 commits into from
Mar 28, 2022

Conversation

daveb-hni
Copy link
Collaborator

Updated the SecurityUtil to allow the value of the Keycloak client to be configurable in properties. Currently uses the Spring security audience value as they are expected to be the same. Also, this value has to injected to a static variable as it's used in static methods so uses method injection instead of directly on the variable.

@daveb-hni daveb-hni requested review from tschia and weskubo-cgi March 28, 2022 17:55
Comment on lines 98 to 101
@Value("${spring.security.oauth2.resourceserver.jwt.audience}")
public void setKeycloakClientStatic(String keycloakClient){
SecurityUtil.KEYCLOAK_CLIENT = keycloakClient;
}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to put this code right under the variable declaration? Might be clearer what's happening that way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, moved method up for clarity

@daveb-hni daveb-hni merged commit d02892d into main Mar 28, 2022
@daveb-hni daveb-hni deleted the 6151-KeyCloak-Client-is-incorrect-for-UAT branch March 28, 2022 18:54
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