nl.surfnet.coin.selfservice.filter
Class ApiOAuthFilter

java.lang.Object
  extended by nl.surfnet.coin.selfservice.filter.ApiOAuthFilter
All Implemented Interfaces:
javax.servlet.Filter

public class ApiOAuthFilter
extends Object
implements javax.servlet.Filter

Servlet filter that performs Oauth 2.0 (authorization code) against api.surfconext.nl and gets group information of the 'admin team'. Based on this information, an additional role is set on the users' Authentication object (or not).


Field Summary
protected static String ORIGINAL_REQUEST_URL
           
protected static String PROCESSED
           
 
Constructor Summary
ApiOAuthFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
           
 void elevateUserIfApplicable(CoinUser coinUser)
          Assign an 'ROLE_ADMIN' role to the given user, if he is member of the admin team.
 void init(javax.servlet.FilterConfig filterConfig)
          No initialization needed.
 void setAdminTeam(String adminTeam)
           
 void setApiClient(nl.surfnet.coin.api.client.OpenConextOAuthClient apiClient)
           
 void setCallbackFlagParameter(String callbackFlagParameter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROCESSED

protected static final String PROCESSED
See Also:
Constant Field Values

ORIGINAL_REQUEST_URL

protected static final String ORIGINAL_REQUEST_URL
See Also:
Constant Field Values
Constructor Detail

ApiOAuthFilter

public ApiOAuthFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
No initialization needed.

Specified by:
init in interface javax.servlet.Filter
Parameters:
filterConfig - the configuration
Throws:
javax.servlet.ServletException

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
IOException
javax.servlet.ServletException

elevateUserIfApplicable

public void elevateUserIfApplicable(CoinUser coinUser)
Assign an 'ROLE_ADMIN' role to the given user, if he is member of the admin team.

Parameters:
coinUser - the CoinUser representing the currently logged in user.

setAdminTeam

public void setAdminTeam(String adminTeam)

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter

setApiClient

public void setApiClient(nl.surfnet.coin.api.client.OpenConextOAuthClient apiClient)

setCallbackFlagParameter

public void setCallbackFlagParameter(String callbackFlagParameter)


Copyright © 2012 SURFnet bv, The Netherlands. All Rights Reserved.