public class PlayWebContext extends Object implements org.pac4j.core.context.WebContext
This class is the web context for Play (used both for Java and Scala).
"Session objects" are managed by the defined SessionStore.
"Request attributes" are saved/restored to/from the context.
| Modifier and Type | Field and Description |
|---|---|
protected play.mvc.Http.Context |
context |
protected Map<String,String[]> |
formParameters |
static play.libs.typedmap.TypedKey<Object> |
PAC4J_USER_PROFILES |
protected play.mvc.Http.Request |
request |
protected play.mvc.Http.Response |
response |
protected String |
responseContent |
protected play.mvc.Http.Session |
session |
protected org.pac4j.core.context.session.SessionStore<PlayWebContext> |
sessionStore |
| Constructor and Description |
|---|
PlayWebContext(play.mvc.Http.Context context,
org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore) |
PlayWebContext(play.api.mvc.RequestHeader requestHeader,
Object body,
org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore)
We retrieve the body apart from the request.
|
PlayWebContext(play.api.mvc.RequestHeader requestHeader,
org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore) |
public static final play.libs.typedmap.TypedKey<Object> PAC4J_USER_PROFILES
protected final play.mvc.Http.Context context
protected final play.mvc.Http.Request request
protected final play.mvc.Http.Response response
protected final play.mvc.Http.Session session
protected org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore
protected String responseContent
public PlayWebContext(play.mvc.Http.Context context,
org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore)
public PlayWebContext(play.api.mvc.RequestHeader requestHeader,
org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore)
public PlayWebContext(play.api.mvc.RequestHeader requestHeader,
Object body,
org.pac4j.core.context.session.SessionStore<PlayWebContext> sessionStore)
requestHeader - the request without the bodybody - the body (maybe)sessionStore - the session storepublic org.pac4j.core.context.session.SessionStore getSessionStore()
getSessionStore in interface org.pac4j.core.context.WebContextpublic play.mvc.Http.Session getJavaSession()
public play.mvc.Http.Context getJavaContext()
public void setResponseStatus(int code)
setResponseStatus in interface org.pac4j.core.context.WebContextpublic void writeResponseContent(String content)
writeResponseContent in interface org.pac4j.core.context.WebContextpublic String getResponseContent()
public String getRequestHeader(String name)
getRequestHeader in interface org.pac4j.core.context.WebContextpublic String getRequestMethod()
getRequestMethod in interface org.pac4j.core.context.WebContextpublic String getRequestParameter(String name)
getRequestParameter in interface org.pac4j.core.context.WebContextpublic Map<String,String[]> getRequestParameters()
getRequestParameters in interface org.pac4j.core.context.WebContextpublic void setResponseHeader(String name, String value)
setResponseHeader in interface org.pac4j.core.context.WebContextpublic String getServerName()
getServerName in interface org.pac4j.core.context.WebContextpublic int getServerPort()
getServerPort in interface org.pac4j.core.context.WebContextpublic String getScheme()
getScheme in interface org.pac4j.core.context.WebContextpublic boolean isSecure()
isSecure in interface org.pac4j.core.context.WebContextpublic String getFullRequestURL()
getFullRequestURL in interface org.pac4j.core.context.WebContextpublic String getRemoteAddr()
getRemoteAddr in interface org.pac4j.core.context.WebContextpublic Object getRequestAttribute(String name)
getRequestAttribute in interface org.pac4j.core.context.WebContextpublic void setRequestAttribute(String name, Object value)
setRequestAttribute in interface org.pac4j.core.context.WebContextpublic Collection<org.pac4j.core.context.Cookie> getRequestCookies()
getRequestCookies in interface org.pac4j.core.context.WebContextpublic String getPath()
getPath in interface org.pac4j.core.context.WebContextpublic void addResponseCookie(org.pac4j.core.context.Cookie cookie)
addResponseCookie in interface org.pac4j.core.context.WebContextpublic void setResponseContentType(String content)
setResponseContentType in interface org.pac4j.core.context.WebContextpublic String getLocation()
Copyright © 2019. All rights reserved.