org.pac4j.javalin.Pac4jContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javalin-pac4j Show documentation
Show all versions of javalin-pac4j Show documentation
Security library for Javalin based on pac4j
package org.pac4j.javalin;
import io.javalin.http.Context;
import org.pac4j.core.context.J2EContext;
import org.pac4j.core.context.session.SessionStore;
public class Pac4jContext extends J2EContext {
private Context javalinCtx;
public Pac4jContext(Context javalinCtx) {
this(javalinCtx, null);
}
public Pac4jContext(Context javalinCtx, SessionStore sessionStore) {
super(javalinCtx.req, javalinCtx.res, sessionStore);
this.javalinCtx = javalinCtx;
}
public Context getJavalinCtx() {
return javalinCtx;
}
@Override
public void writeResponseContent(String content) {
javalinCtx.result(content);
}
@Override
public void setResponseStatus(int code) {
javalinCtx.status(code);
}
@Override
public String getPath() {
return javalinCtx.path();
}
@Override
public void setResponseHeader(String name, String value) {
super.setResponseHeader(name, value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy