You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.2 KiB
33 lines
1.2 KiB
package com.fr.plugin.xxxx.sso.filter; |
|
|
|
import com.fr.decision.fun.impl.AbstractLogInOutEventProvider; |
|
import com.fr.decision.webservice.login.LogInOutResultInfo; |
|
import com.fr.general.PropertiesUtils; |
|
import com.fr.stable.StringUtils; |
|
|
|
import java.util.Properties; |
|
|
|
import static com.fr.plugin.xxxx.sso.utils.CommonUtils.getProperty; |
|
|
|
|
|
/** |
|
* @Author fr.open |
|
* @since 2021/8/24 |
|
**/ |
|
public class CustomLogInOutEventProvider extends AbstractLogInOutEventProvider { |
|
|
|
@Override |
|
public String logoutAction(LogInOutResultInfo result) { |
|
Properties props = PropertiesUtils.getProperties("sso"); |
|
String apiClientId = getProperty(props, "api.client_id", false); |
|
String logoutURL = getProperty(props, "api.logout", true); |
|
String logoutRedirectURL = getProperty(props, "api.logout.redirect-url", StringUtils.EMPTY, true); |
|
if (StringUtils.isBlank(logoutURL)) { |
|
return null; |
|
} |
|
if (StringUtils.isBlank(logoutRedirectURL)) { |
|
return String.format("%s?redirectToLogin=false&entityId=%s", logoutURL, apiClientId); |
|
} |
|
return String.format("%s?redirctToUrl=%s&redirectToLogin=true&entityId=%s", logoutURL, logoutRedirectURL, apiClientId); |
|
} |
|
}
|
|
|