-
Notifications
You must be signed in to change notification settings - Fork 32
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
adding api manager keycloak keymanager code #1
Conversation
} | ||
// for(JSONValue value : (JSONArray)responseMap.get(KeycloakConstants.CLIENT_REDIRECT_URIS)){ | ||
// uris.add(value.asString()); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we remove this if not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I will remove it.
if((Boolean) responseMap.get(KeycloakConstants.GRANT_TYPE_CLIENT_CREDENTIALS_KEYCLOAK)){ | ||
grantTypeList.add(KeycloakConstants.GRANT_TYPE_CLIENT_CREDENTIALS); | ||
} | ||
if((Boolean) responseMap.get(KeycloakConstants.GRANT_TYPE_PASSWORD_KEYCLOAK)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems the code if not formatted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Will reformat.
} catch (IOException e) { | ||
handleException("Error while reading response body", e); | ||
} finally { | ||
closeResources(null, httpClient); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use try-resource instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, the closable resources defined in try are final. I cannot initialize my buffered reader there since I need to reassign the entity value from HTTP response to it. To keep the code consistent, I will keep using the finally block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have used multiple try blocks and accommodated this recommendation.
Purpose
Adding initial code base for api manager keycloak keymanager component.
Goals
Provision Keycloak as a third party key manager for WSO2 APIM 2.6
Approach
Keycloak Client is written extending the AbstractKeyManager class.
User stories
Adopting a third party key manager, Keycloak for API Manager 2.6.0
Release note
Third party keymanager implementation for API Manager and Keycloak.
Documentation
Will be added in the future.
Training
N/A
Certification
N/A. Does not lie on the major flaws in APIM since it is custom implementation.
Marketing
N/A
Automation tests
N/A
Security checks
Samples
Related PRs
N/A
Migrations (if applicable)
N/A
Test environment
JDK 8
Learning
Keycloak official documentation
https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_clients_resource