-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LogoutReturnUrl property to application management API models.
- Loading branch information
1 parent
799837b
commit f118c60
Showing
10 changed files
with
172 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...pi/server/application/management/v1/core/functions/application/UpdateLogoutReturnUrl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application; | ||
|
||
import org.wso2.carbon.identity.api.server.application.management.common.ApplicationManagementConstants; | ||
import org.wso2.carbon.identity.api.server.application.management.v1.core.functions.UpdateFunction; | ||
import org.wso2.carbon.identity.application.common.model.ServiceProvider; | ||
import org.wso2.carbon.identity.application.common.model.ServiceProviderProperty; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* Update logout return url. | ||
*/ | ||
public class UpdateLogoutReturnUrl implements UpdateFunction<ServiceProvider, String> { | ||
|
||
@Override | ||
public void apply(ServiceProvider serviceProvider, String logoutReturnUrl) { | ||
|
||
ServiceProviderProperty[] spProperties = serviceProvider.getSpProperties(); | ||
boolean logoutURLExists = false; | ||
|
||
if (spProperties == null) { | ||
spProperties = new ServiceProviderProperty[0]; | ||
} | ||
for (ServiceProviderProperty spProperty : spProperties) { | ||
if (ApplicationManagementConstants.PROP_LOGOUT_RETURN_URL.equals(spProperty.getName())) { | ||
spProperty.setValue(logoutReturnUrl); | ||
logoutURLExists = true; | ||
} | ||
} | ||
if (!logoutURLExists) { | ||
ServiceProviderProperty logoutURLProperty = new ServiceProviderProperty(); | ||
logoutURLProperty.setName(ApplicationManagementConstants.PROP_LOGOUT_RETURN_URL); | ||
logoutURLProperty.setValue(logoutReturnUrl); | ||
logoutURLProperty.setDisplayName(ApplicationManagementConstants.LOGOUT_RETURN_URL_DISPLAY_NAME); | ||
spProperties = Arrays.copyOf(spProperties, spProperties.length + 1); | ||
spProperties[spProperties.length - 1] = logoutURLProperty; | ||
} | ||
serviceProvider.setSpProperties(spProperties); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.