public class OAuth2Request extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OAuth2Request.ContextKey
Each key that can be stored in the
AttributesContext has a specific key
used for access and retrieval. |
Modifier | Constructor and Description |
---|---|
|
OAuth2Request(org.forgerock.openam.rest.representations.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.
|
org.forgerock.json.JsonValue |
getBody()
Gets the body of the request.
|
ClientRegistration |
getClientRegistration()
Get the OAuth2 client registration of the request.
|
org.forgerock.json.jose.jws.SignedJwt |
getConsentResponseJwt() |
<T> Optional<T> |
getContextFor(OAuth2Request.ContextKey key,
Class<T> type)
The request context is a generic storage mechanism of the
OAuth2Request that
allows the various layers of OAuth2 processing to inter operate. |
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.
|
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(org.forgerock.json.jose.jws.SignedJwt jwt) |
void |
setContextFor(OAuth2Request.ContextKey key,
Object value)
Assign a specific object in a per-request context.
|
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.
|
protected OAuth2Request(OAuth2Request request)
request
- the OAuth2 request@Inject public OAuth2Request(org.forgerock.openam.rest.representations.JacksonRepresentationFactory jacksonRepresentationFactory, org.restlet.Request request)
jacksonRepresentationFactory
- The factory class for JacksonRepresentation
.request
- The Restlet request.public <T> Optional<T> getContextFor(OAuth2Request.ContextKey key, Class<T> type)
OAuth2Request
that
allows the various layers of OAuth2 processing to inter operate.
NB: Not supported API as the contents are considered internal for OAuth2 processingT
- The type of the value stored in the context.key
- The OAuth2Request.ContextKey
indicating the specific value to be retrieved.public void setContextFor(OAuth2Request.ContextKey key, Object value)
key
- Non null OAuth2Request.ContextKey
to assign the value to.value
- A possibly null value.OAuth2Request.getContextFor(ContextKey, Class)
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 org.forgerock.json.JsonValue getBody()
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(org.forgerock.json.jose.jws.SignedJwt jwt)
public org.forgerock.json.jose.jws.SignedJwt getConsentResponseJwt()
public void setClientRegistration(ClientRegistration clientRegistration)
clientRegistration
- The client registration.Copyright © 2010-2017, ForgeRock All Rights Reserved.