Class OAuth2Resource2Interceptor

All Implemented Interfaces:
Interceptor

public class OAuth2Resource2Interceptor extends AbstractInterceptorWithSession
Description
Allows only authorized HTTP requests to pass through. Unauthorized requests get a redirect to the authorization server as response.
Topic
6. Security
  • Field Details

  • Constructor Details

    • OAuth2Resource2Interceptor

      public OAuth2Resource2Interceptor()
  • Method Details

    • init

      public void init() throws Exception
      Description copied from class: AbstractInterceptor
      Called after parsing is complete and this has been added to the object tree (whose root is Router).
      Overrides:
      init in class AbstractInterceptorWithSession
      Throws:
      Exception
    • init

      public void init(Router router) throws Exception
      Specified by:
      init in interface Interceptor
      Overrides:
      init in class AbstractInterceptor
      Throws:
      Exception
    • handleResponseInternal

      protected Outcome handleResponseInternal(Exchange exc)
      Description copied from class: AbstractInterceptorWithSession
      Do not override handleResponse like usual but use this method to implement your own handle response logic
      Specified by:
      handleResponseInternal in class AbstractInterceptorWithSession
      Returns:
    • handleRequestInternal

      public final Outcome handleRequestInternal(Exchange exc) throws Exception
      Description copied from class: AbstractInterceptorWithSession
      Do not override handleRequest like usual but use this method to implement your own handle request logic
      Specified by:
      handleRequestInternal in class AbstractInterceptorWithSession
      Returns:
      Throws:
      Exception
    • logOutSession

      public void logOutSession(Exchange exc)
    • respondWithRedirect

      public Outcome respondWithRedirect(Exchange exc) throws Exception
      Throws:
      Exception
    • getShortDescription

      public String getShortDescription()
      Specified by:
      getShortDescription in interface Interceptor
      Overrides:
      getShortDescription in class AbstractInterceptor
    • getOriginalExchangeStore

      public OriginalExchangeStore getOriginalExchangeStore()
    • setOriginalExchangeStore

      public void setOriginalExchangeStore(OriginalExchangeStore originalExchangeStore)
    • isSkipUserInfo

      public boolean isSkipUserInfo()
    • setSkipUserInfo

      public void setSkipUserInfo(boolean skipUserInfo)
    • setPublicUrlManager

      public void setPublicUrlManager(PublicUrlManager publicUrlManager)
    • getPublicUrlManager

      public PublicUrlManager getPublicUrlManager()
    • getAuthService

      public AuthorizationService getAuthService()
    • setAuthService

      public void setAuthService(AuthorizationService auth)
    • getRevalidateTokenAfter

      public int getRevalidateTokenAfter()
    • setRevalidateTokenAfter

      public void setRevalidateTokenAfter(int revalidateTokenAfter)
      Default
      -1
      Description
      time in seconds until a oauth2 access token is revalidatet with authorization server. This is disabled for values < 0
    • getCallbackPath

      public String getCallbackPath()
    • setCallbackPath

      public void setCallbackPath(String callbackPath)
      Default
      oauth2callback
      Description
      the path used for the OAuth2 callback. ensure that it does not collide with any path used by the application
    • getCustomHeaderUserPropertyPrefix

      public String getCustomHeaderUserPropertyPrefix()
    • setCustomHeaderUserPropertyPrefix

      public void setCustomHeaderUserPropertyPrefix(String customHeaderUserPropertyPrefix)
      Default
      null
      Description
      A user property prefix (e.g. "header"), which can be used to make the interceptor emit custom per-user headers. For example, if you have a user property "headerX: Y" on a user U, and the user U logs in, all requests belonging to this user will have an additional HTTP header "X: Y". If null, this feature is disabled.
    • getLogoutUrl

      public String getLogoutUrl()
    • setLogoutUrl

      public void setLogoutUrl(String logoutUrl)
      Description
      Path (as seen by the user agent) to call to trigger a log out. If the Authorization Server supports OpenID Connect RP-Initiated Logout 1.0, the user logout ("single log out") will be triggered there as well.
    • getAfterLogoutUrl

      public String getAfterLogoutUrl()
    • setAfterLogoutUrl

      public void setAfterLogoutUrl(String afterLogoutUrl)
    • getLoginParameters

      public List<LoginParameter> getLoginParameters()
    • setLoginParameters

      public void setLoginParameters(List<LoginParameter> loginParameters)
    • isAppendAccessTokenToRequest

      public boolean isAppendAccessTokenToRequest()
    • setAppendAccessTokenToRequest

      public void setAppendAccessTokenToRequest(boolean appendAccessTokenToRequest)
    • getAfterErrorUrl

      public String getAfterErrorUrl()
    • setAfterErrorUrl

      public void setAfterErrorUrl(String afterErrorUrl)
    • isOnlyRefreshToken

      public boolean isOnlyRefreshToken()
    • setOnlyRefreshToken

      public void setOnlyRefreshToken(boolean onlyRefreshToken)