|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.surfnet.oaaas.auth.AbstractFilter
org.surfnet.oaaas.auth.AbstractUserConsentHandler
public abstract class AbstractUserConsentHandler
Responsible for handling user consent.
| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.surfnet.oaaas.auth.AbstractFilter |
|---|
AUTH_STATE, RETURN_URI |
| Constructor Summary | |
|---|---|
AbstractUserConsentHandler()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.surfnet.oaaas.auth.AbstractFilter |
|---|
getAuthStateValue, getReturnUri, setAuthStateValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String GRANTED_SCOPES
public static final String CLIENT
| Constructor Detail |
|---|
public AbstractUserConsentHandler()
| Method Detail |
|---|
public final Client getClient(javax.servlet.ServletRequest request)
request - the ServletRequest
public final void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
IOException
javax.servlet.ServletException
public 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)#setScopes
request - 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 token
IOException
javax.servlet.ServletException
protected 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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||