public class OAuth2Request extends Object
Modifier | Constructor and Description |
---|---|
|
OAuth2Request(JacksonRepresentationFactory jacksonRepresentationFactory,
org.restlet.Request request)
Constructs a new RestletOAuth2Request.
|
protected |
OAuth2Request(OAuth2Request request)
Copy the OAuth2 request.
|
Modifier and Type | Method and Description |
---|---|
static OAuth2Request |
forRealm(String realm)
Creates an
OAuth2Request which holds the provided realm only. |
Object |
getAttribute(String name)
Gets the value for an attribute from the request with the specified name.
|
JsonValue |
getBody()
Gets the body of the request.
|
ClientRegistration |
getClientRegistration()
Get the OAuth2 client registration of the request.
|
SignedJwt |
getConsentResponseJwt() |
Locale |
getLocale()
Get the request locale.
|
String |
getOps()
Gets the user's session public reference for this request.
|
<T> T |
getParameter(String name)
Gets the specified parameter from the request.
|
<T> T |
getParameter(String name,
boolean checkQueryParam)
Gets the specified parameter from the request.
|
int |
getParameterCount(String name)
Gets the count of the parameter present in the request with the given name
|
Set<String> |
getParameterNames()
Gets the name of the parameters in the current request
|
String |
getQueryParameter(String name)
Gets the value for a query parameter from the request with the specified name.
|
org.restlet.Request |
getRequest()
Gets the actual underlying request.
|
String |
getSession()
Gets the user's session for this request.
|
<T extends Token> |
getToken(Class<T> tokenClass)
Get a Token that is in play for this request.
|
Collection<Token> |
getTokens()
Get all the tokens that have been used in this request.
|
void |
setClientRegistration(ClientRegistration clientRegistration)
Set the OAuth2 client registration.
|
void |
setConsentResponseJwt(SignedJwt jwt) |
void |
setOps(String ops)
Sets the user's session public reference for this request.
|
void |
setSession(String sessionId)
Sets the user's session for this request.
|
<T extends Token> |
setToken(Class<T> tokenClass,
T token)
Set a Token that is in play for this request.
|
protected OAuth2Request(OAuth2Request request)
request
- the OAuth2 request@Inject public OAuth2Request(JacksonRepresentationFactory jacksonRepresentationFactory, org.restlet.Request request)
jacksonRepresentationFactory
- The factory class for JacksonRepresentation
.request
- The Restlet request.public org.restlet.Request getRequest()
public <T> T getParameter(String name)
T
- The type of the parameter.name
- The name of the parameter.public <T> T getParameter(String name, boolean checkQueryParam)
This method will first check the attributes then query string if checkQueryParam == true, then move onto check entity values if it is a post.
T
- The type of the parameter.name
- The name of the parameter.checkQueryParam
- boolean value indicating if the query parameter should be checked.public int getParameterCount(String name)
name
- The name of the parameterpublic Set<String> getParameterNames()
public Object getAttribute(String name)
name
- The name.null
public String getQueryParameter(String name)
name
- The name.null
.public JsonValue getBody()
public <T extends Token> void setToken(Class<T> tokenClass, T token)
T
- The type of token.tokenClass
- The token type.token
- The token instance.public <T extends Token> T getToken(Class<T> tokenClass)
T
- The type of token.tokenClass
- The token type.public Collection<Token> getTokens()
public void setSession(String sessionId)
sessionId
- The user's session.public String getSession()
public void setOps(String ops)
ops
- The user's session public reference.public String getOps()
public Locale getLocale()
public ClientRegistration getClientRegistration()
public static OAuth2Request forRealm(String realm)
OAuth2Request
which holds the provided realm only.realm
- The request realm.OAuth2Request
.public void setConsentResponseJwt(SignedJwt jwt)
jwt
- A possibly null consent response to assign to this request.public SignedJwt getConsentResponseJwt()
SignedJwt
if assigned.public void setClientRegistration(ClientRegistration clientRegistration)
clientRegistration
- The client registration.Copyright © 2010-2018, ForgeRock All Rights Reserved.