Class OAuthAuthenticationFilter

java.lang.Object
org.exoplatform.container.web.AbstractFilter
org.gatein.sso.agent.filter.api.AbstractSSOInterceptor
io.meeds.oauth.web.OAuthAuthenticationFilter
All Implemented Interfaces:
jakarta.servlet.Filter, org.gatein.sso.agent.filter.api.SSOInterceptor

public class OAuthAuthenticationFilter extends org.gatein.sso.agent.filter.api.AbstractSSOInterceptor
This filter has already access to authenticated OAuth principal, so it's work starts after successful OAuth authentication. Filter is useful only for anonymous user Responsibility of this filter is to handle integration with GateIn (Redirect to GateIn registration if needed, establish context and redirect to JAAS to finish GateIn authentication etc)
  • Field Summary

    Fields inherited from class org.gatein.sso.agent.filter.api.AbstractSSOInterceptor

    PORTAL_CONTAINER_SUBSTITUTION_PATTERN

    Fields inherited from class org.exoplatform.container.web.AbstractFilter

    config, servletContextName
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    cleanAuthenticationContext(jakarta.servlet.http.HttpServletRequest httpRequest)
     
    void
     
    void
    doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain)
     
    protected String
    getLoginRedirectUrl(jakarta.servlet.http.HttpServletRequest req, String username)
     
    protected String
    getRegistrationRedirectURL(jakarta.servlet.http.HttpServletRequest req)
     
    protected void
    handleRedirectToPortalLogin(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, org.exoplatform.services.organization.User portalUser, OAuthPrincipal principal)
     
    protected void
    handleRedirectToRegistrationForm(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, OAuthPrincipal principal)
     
    protected void
     
    protected void
    processPrincipal(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, OAuthPrincipal principal)
     

    Methods inherited from class org.gatein.sso.agent.filter.api.AbstractSSOInterceptor

    afterInit, getExoContainer, getInitParameter, initWithParams

    Methods inherited from class org.exoplatform.container.web.AbstractFilter

    getContainer, getServletContext, init, requirePortalEnvironment

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jakarta.servlet.Filter

    init
  • Constructor Details

    • OAuthAuthenticationFilter

      public OAuthAuthenticationFilter()
  • Method Details

    • initImpl

      protected void initImpl()
      Specified by:
      initImpl in class org.gatein.sso.agent.filter.api.AbstractSSOInterceptor
    • destroy

      public void destroy()
    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
      Throws:
      IOException
      jakarta.servlet.ServletException
    • processPrincipal

      protected void processPrincipal(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, OAuthPrincipal principal) throws IOException
      Throws:
      IOException
    • handleRedirectToRegistrationForm

      protected void handleRedirectToRegistrationForm(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, OAuthPrincipal principal) throws IOException
      Throws:
      IOException
    • getRegistrationRedirectURL

      protected String getRegistrationRedirectURL(jakarta.servlet.http.HttpServletRequest req)
    • handleRedirectToPortalLogin

      protected void handleRedirectToPortalLogin(jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, org.exoplatform.services.organization.User portalUser, OAuthPrincipal principal) throws IOException
      Throws:
      IOException
    • getLoginRedirectUrl

      protected String getLoginRedirectUrl(jakarta.servlet.http.HttpServletRequest req, String username)
    • cleanAuthenticationContext

      protected void cleanAuthenticationContext(jakarta.servlet.http.HttpServletRequest httpRequest)