
org.pac4j.play.LogoutController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of play-pac4j_3 Show documentation
Show all versions of play-pac4j_3 Show documentation
Security library for Play framework based on pac4j using Scala 3
The newest version!
package org.pac4j.play;
import lombok.Getter;
import lombok.Setter;
import org.pac4j.core.adapter.FrameworkAdapter;
import org.pac4j.core.config.Config;
import org.pac4j.play.context.PlayFrameworkParameters;
import play.libs.concurrent.HttpExecutionContext;
import play.mvc.Controller;
import play.mvc.Http;
import play.mvc.Result;
import javax.inject.Inject;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
/**
* This filter handles the (application + identity provider) logout process.
*
* @author Jerome Leleu
* @since 2.0.0
*/
public class LogoutController extends Controller {
@Getter
@Setter
private String defaultUrl;
@Getter
@Setter
private String logoutUrlPattern;
@Getter
@Setter
private Boolean localLogout;
@Getter
@Setter
private Boolean destroySession;
@Getter
@Setter
private Boolean centralLogout;
@Inject
protected Config config;
@Inject
protected HttpExecutionContext ec;
public CompletionStage logout(final Http.Request request) {
FrameworkAdapter.INSTANCE.applyDefaultSettingsIfUndefined(config);
return CompletableFuture.supplyAsync(() ->
(Result) config.getLogoutLogic().perform(config, defaultUrl, logoutUrlPattern, localLogout,
destroySession, centralLogout, new PlayFrameworkParameters(request))
, ec.current());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy