public class NoopUserConsentHandler extends AbstractUserConsentHandler
AbstractUserConsentHandler that
contains no consent handling but only fulfills the contract of the
UserConsentFilter. Useful for testing and demonstration purposes
only, of course not safe for production.CLIENT, GRANTED_SCOPESAUTH_STATE, RETURN_URI| Constructor and Description |
|---|
NoopUserConsentHandler() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
destroy, doFilter, getClient, init, setGrantedScopesgetAuthStateValue, getReturnUri, setAuthStateValuepublic 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
AbstractUserConsentHandlerFormUserConsentHandler 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 locationAbstractUserConsentHandler.getClient(javax.servlet.ServletRequest) for accessing the
Client dataWhen consent granted:
AbstractFilter.setAuthStateValue(javax.servlet.ServletRequest, String)#setScopeshandleUserConsent in class AbstractUserConsentHandlerrequest - 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.ServletExceptionCopyright © 2012-2013 SURFnet bv, The Netherlands. All Rights Reserved.