public abstract class AbstractUserConsentHandler extends AbstractFilter
| Modifier and Type | Field and Description |
|---|---|
static String |
CLIENT
Constant to get the Client when the control should be returned to the
implementor
|
static String |
GRANTED_SCOPES
The constant that contains the scopes, set by concrete userConsentHandlers
and consumed by the authorization endpoint.
|
AUTH_STATE, RETURN_URI| Constructor and Description |
|---|
AbstractUserConsentHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
Client |
getClient(javax.servlet.ServletRequest request)
Get the Client from the request context to use in handling user consent
|
abstract void |
handleUserConsent(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain,
String authStateValue,
String returnUri,
Client client)
Implement this method to perform the actual authentication.
|
void |
init(javax.servlet.FilterConfig filterConfig) |
protected void |
setGrantedScopes(javax.servlet.ServletRequest request,
String[] scopes)
Set the granted scopes of the consent on the request.
|
getAuthStateValue, getReturnUri, setAuthStateValuepublic static final String GRANTED_SCOPES
public static final String CLIENT
public final Client getClient(javax.servlet.ServletRequest request)
request - the ServletRequestpublic final void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic abstract void handleUserConsent(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain,
String authStateValue,
String returnUri,
Client client)
throws IOException,
javax.servlet.ServletException
FormUserConsentHandler as an example.
In general, the contract is:
assert that the user has granted consent. You can use the request and response for this. When not yet granted consent:
AbstractFilter.getAuthStateValue(javax.servlet.ServletRequest) to
pass-around for user agent communicationAbstractFilter.getReturnUri(javax.servlet.ServletRequest) if you need to
step out and return to the current locationgetClient(javax.servlet.ServletRequest) for accessing the
Client dataWhen consent granted:
AbstractFilter.setAuthStateValue(javax.servlet.ServletRequest, String)#setScopesrequest - the ServletRequestresponse - the ServletResponsechain - the original http servlet filter chainauthStateValue - the authState nonce to set back on the ServletRequest when
donereturnUri - the startpoint of the chain if you want to return from a form or
other (external) componentclient - the Client wished to obtain an access tokenIOExceptionjavax.servlet.ServletExceptionprotected final void setGrantedScopes(javax.servlet.ServletRequest request,
String[] scopes)
request - the original ServletRequestscopes - the String[] scopes.public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic void destroy()
Copyright © 2012-2013 SURFnet bv, The Netherlands. All Rights Reserved.