Class OAuth2Resource2Interceptor
java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.AbstractInterceptorWithSession
com.predic8.membrane.core.interceptor.oauth2client.OAuth2Resource2Interceptor
- All Implemented Interfaces:
Interceptor
- Description
- Allows only authorized HTTP requests to pass through. Unauthorized requests get a redirect to the authorization server as response.
- Topic
- 6. Security
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.predic8.membrane.core.interceptor.Interceptor
Interceptor.Flow -
Field Summary
FieldsFields inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
name, router -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfinal OutcomeDo not override handleRequest like usual but use this method to implement your own handle request logicprotected OutcomeDo not override handleResponse like usual but use this method to implement your own handle response logicvoidinit()Called after parsing is complete and this has been added to the object tree (whose root is Router).voidbooleanbooleanbooleanvoidlogOutSession(Exchange exc) voidsetAfterErrorUrl(String afterErrorUrl) voidsetAfterLogoutUrl(String afterLogoutUrl) voidsetAppendAccessTokenToRequest(boolean appendAccessTokenToRequest) voidvoidsetCallbackPath(String callbackPath) voidsetCustomHeaderUserPropertyPrefix(String customHeaderUserPropertyPrefix) voidsetLoginParameters(List<LoginParameter> loginParameters) voidsetLogoutUrl(String logoutUrl) voidsetOnlyRefreshToken(boolean onlyRefreshToken) voidsetOriginalExchangeStore(OriginalExchangeStore originalExchangeStore) voidsetPublicUrlManager(PublicUrlManager publicUrlManager) voidsetRevalidateTokenAfter(int revalidateTokenAfter) voidsetSkipUserInfo(boolean skipUserInfo) Methods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptorWithSession
getSessionManager, handleRequest, handleResponse, setSessionManagerMethods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getDisplayName, getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, handleAbort, setDisplayName, setFlow
-
Field Details
-
ERROR_STATUS
- See Also:
-
EXPECTED_AUDIENCE
- See Also:
-
WANTED_SCOPE
- See Also:
-
-
Constructor Details
-
OAuth2Resource2Interceptor
public OAuth2Resource2Interceptor()
-
-
Method Details
-
init
Description copied from class:AbstractInterceptorCalled after parsing is complete and this has been added to the object tree (whose root is Router).- Overrides:
initin classAbstractInterceptorWithSession- Throws:
Exception
-
init
- Specified by:
initin interfaceInterceptor- Overrides:
initin classAbstractInterceptor- Throws:
Exception
-
handleResponseInternal
Description copied from class:AbstractInterceptorWithSessionDo not override handleResponse like usual but use this method to implement your own handle response logic- Specified by:
handleResponseInternalin classAbstractInterceptorWithSession- Returns:
-
handleRequestInternal
Description copied from class:AbstractInterceptorWithSessionDo not override handleRequest like usual but use this method to implement your own handle request logic- Specified by:
handleRequestInternalin classAbstractInterceptorWithSession- Returns:
- Throws:
Exception
-
logOutSession
-
respondWithRedirect
- Throws:
Exception
-
getShortDescription
- Specified by:
getShortDescriptionin interfaceInterceptor- Overrides:
getShortDescriptionin classAbstractInterceptor
-
getOriginalExchangeStore
-
setOriginalExchangeStore
-
isSkipUserInfo
public boolean isSkipUserInfo() -
setSkipUserInfo
public void setSkipUserInfo(boolean skipUserInfo) -
setPublicUrlManager
-
getPublicUrlManager
-
getAuthService
-
setAuthService
-
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
-
setCallbackPath
- Default
- oauth2callback
- Description
- the path used for the OAuth2 callback. ensure that it does not collide with any path used by the application
-
getCustomHeaderUserPropertyPrefix
-
setCustomHeaderUserPropertyPrefix
- 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
-
setLogoutUrl
- 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
-
setAfterLogoutUrl
-
getLoginParameters
-
setLoginParameters
-
isAppendAccessTokenToRequest
public boolean isAppendAccessTokenToRequest() -
setAppendAccessTokenToRequest
public void setAppendAccessTokenToRequest(boolean appendAccessTokenToRequest) -
getAfterErrorUrl
-
setAfterErrorUrl
-
isOnlyRefreshToken
public boolean isOnlyRefreshToken() -
setOnlyRefreshToken
public void setOnlyRefreshToken(boolean onlyRefreshToken)
-