-
Notifications
You must be signed in to change notification settings - Fork 588
Add slo support for multiple orgs #7583
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
base: master
Are you sure you want to change the base?
Conversation
|
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.
Pull Request Overview
This PR enhances organization-based authentication and logout handling by introducing deep copying of authenticator configurations and implementing support for multiple organization authenticators during logout flows.
- Adds a
deepCopymethod toAuthenticatorConfigfor creating deep copies using Java serialization - Implements organization authenticator tracking in
AuthenticationContextto handle multiple organization logins during logout - Refactors logout request handling to support iterating through organization-specific authenticators
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| DefaultStepHandler.java | Adds deep copy call for authenticator config in organization login flows to prevent shared state issues |
| DefaultLogoutRequestHandler.java | Implements special handling for "SSO" IDP logout with organization authenticator iteration logic |
| AuthenticationContext.java | Adds map to track organization authenticator configs and counter for current organization being processed |
| AuthenticatorConfig.java | Implements generic deep copy utility using Java object serialization |
| import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedIdPData; | ||
| import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser; | ||
| import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticationResult; | ||
| import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticationResult;xw |
Copilot
AI
Oct 29, 2025
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.
Remove the trailing 'xw' characters from the import statement.
| import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticationResult;xw | |
| import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticationResult; |
| public static <T extends Serializable> T deepCopy(T obj) { | ||
|
|
||
| try { | ||
| ByteArrayOutputStream bos = new ByteArrayOutputStream(); | ||
| ObjectOutputStream oos = new ObjectOutputStream(bos); | ||
| oos.writeObject(obj); | ||
| ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); | ||
| ObjectInputStream ois = new ObjectInputStream(bis); | ||
| return (T) ois.readObject(); | ||
| } catch (Exception e) { | ||
| throw new RuntimeException(e); | ||
| } | ||
| } |
Copilot
AI
Oct 29, 2025
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.
The deepCopy method does not close the streams (ObjectOutputStream and ObjectInputStream), which could lead to resource leaks. Wrap streams in try-with-resources blocks to ensure proper cleanup.
| this.tenantDomain = tenantDomain; | ||
| } | ||
|
|
||
| public static <T extends Serializable> T deepCopy(T obj) { |
Copilot
AI
Oct 29, 2025
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.
Missing docstring for the public method 'deepCopy'. All public methods should have a docstring explaining the purpose, parameters, return value, and potential exceptions.
| public Map<Integer, AuthenticatorConfig> getOrgAuthenticatorConfigs() { | ||
|
|
||
| return orgAuthenticatorConfigs; | ||
| } |
Copilot
AI
Oct 29, 2025
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.
Missing docstring for the public method 'getOrgAuthenticatorConfigs'. All public methods should have a docstring.
| public void addOrganicAuthenticatorConfig(int orgNumber, AuthenticatorConfig authenticatorConfig) { | ||
|
|
||
| this.orgAuthenticatorConfigs.put(orgNumber, authenticatorConfig); | ||
| } |
Copilot
AI
Oct 29, 2025
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.
Missing docstring for the public method 'addOrganicAuthenticatorConfig'. All public methods should have a docstring.
| public int getCurrentOrgNumber() { | ||
|
|
||
| return currentOrgNumber; | ||
| } |
Copilot
AI
Oct 29, 2025
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.
Missing docstring for the public method 'getCurrentOrgNumber'. All public methods should have a docstring.
| public void setCurrentOrgNumber(int currentOrgNumber) { | ||
|
|
||
| this.currentOrgNumber = currentOrgNumber; | ||
| } |
Copilot
AI
Oct 29, 2025
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.
Missing docstring for the public method 'setCurrentOrgNumber'. All public methods should have a docstring.


Proposed changes in this pull request
sample fix for $Subject