Class OAuth2ResourceInterceptor
java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.oauth2.OAuth2ResourceInterceptor
- 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 TypeMethodDescriptionintvoidfinal OutcomehandleRequest(Exchange exc) booleanhandleRequest(Exchange exc, String state, String publicURL, SessionManager.Session session) handleResponse(Exchange exc) voidbooleanisLoginRequest(Exchange exc) voidvoidsetLoginLocation(String login) voidsetLoginPath(String loginPath) voidsetPublicURL(String publicURL) voidsetRevalidateTokenAfter(int revalidateTokenAfter) voidsetSessionManager(SessionManager sessionManager) Methods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getDisplayName, getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, handleAbort, init, setDisplayName, setFlow
-
Field Details
-
OAUTH2_ANSWER
- See Also:
-
OA2REDIRECT
- See Also:
-
-
Constructor Details
-
OAuth2ResourceInterceptor
public OAuth2ResourceInterceptor()
-
-
Method Details
-
getLoginLocation
-
setLoginLocation
- Description
- location of the login dialog template (a directory containing the index.html file as well as possibly other resources). Required for older browsers to work.
- Example
- file:c:/work/login/
-
getLoginPath
-
setLoginPath
- Default
- /login/
- Description
- context path of the login dialog
-
getPublicURL
-
setPublicURL
-
getAuthService
-
setAuthService
-
getSessionManager
-
setSessionManager
-
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
-
init
- Specified by:
initin interfaceInterceptor- Overrides:
initin classAbstractInterceptor- Throws:
Exception
-
handleRequest
- Specified by:
handleRequestin interfaceInterceptor- Overrides:
handleRequestin classAbstractInterceptor- Throws:
Exception
-
handleResponse
- Specified by:
handleResponsein interfaceInterceptor- Overrides:
handleResponsein classAbstractInterceptor- Throws:
Exception
-
isLoginRequest
-
handleLoginRequest
- Throws:
Exception
-
handleRequest
public boolean handleRequest(Exchange exc, String state, String publicURL, SessionManager.Session session) throws Exception - Throws:
Exception
-
getShortDescription
- Specified by:
getShortDescriptionin interfaceInterceptor- Overrides:
getShortDescriptionin classAbstractInterceptor
-