Package org.wso2.carbon.ui
Interface CarbonUIAuthenticator
- All Known Implementing Classes:
AbstractCarbonUIAuthenticator,BasicAuthUIAuthenticator,DefaultCarbonAuthenticator
public interface CarbonUIAuthenticator
This is the interface of the Authenticator to Carbon UI framework. Implement this interface in a
bundle and drop-in to the framework and it will be automatically called. The authenticator has
the freedom to decide how it does the authentication.
When an authentication request is received by the framework each authenticator will be checked to
see who handles the request, i.e. isHandle() method of each authenticator will be called in the
priority order given by the getPriority() method. Highest priority authenticator that returns
true for the isHandle() method will be given the responsibility of authentication.
Priority is defined as higher the number higher the priority.
-
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(javax.servlet.http.HttpServletRequest request) Authenticates the given request.voidauthenticateWithCookie(javax.servlet.http.HttpServletRequest request) Handles authentication during a session expiration.booleancanHandle(javax.servlet.http.HttpServletRequest request) This method will check whether given request can be handled by the authenticator.Gets a list of urls to skip authentication.Returns the name of the authenticator.intGets the authenticator priority.Gets a list of urls to skip session validation.booleanBy default all the authenticators found in the system are enabled.booleanIf Authenticator does not need to have login page - set this to true.voidunauthenticate(Object object) Invalidates the authentication session.
-
Method Details
-
canHandle
boolean canHandle(javax.servlet.http.HttpServletRequest request) This method will check whether given request can be handled by the authenticator. If authenticator is capable of handling given request this method will returntrue. Else this will returnfalse.- Parameters:
object- The request to authenticate.- Returns:
trueif this authenticator can handle the request, elsefalse.
-
authenticate
void authenticate(javax.servlet.http.HttpServletRequest request) throws org.wso2.carbon.core.common.AuthenticationException Authenticates the given request.- Parameters:
object- The request to be authenticate.- Throws:
org.wso2.carbon.core.common.AuthenticationException- If an error occurred during authentication process.
-
authenticateWithCookie
void authenticateWithCookie(javax.servlet.http.HttpServletRequest request) throws org.wso2.carbon.core.common.AuthenticationException Handles authentication during a session expiration. Usually the request is a cookie.- Parameters:
object- The request to be re-authenticated.- Throws:
org.wso2.carbon.core.common.AuthenticationException- If an error occurred during authentication process.
-
unauthenticate
Invalidates the authentication session. TODO why we need this ? An authenticator should not maintain a session- Parameters:
object- The request to invalidate TODO (?)- Throws:
Exception- If an error occurred during authentication process.
-
getPriority
int getPriority()Gets the authenticator priority.- Returns:
- The integer representing the priority. Higher the value, higher the priority.
-
getAuthenticatorName
String getAuthenticatorName()Returns the name of the authenticator.- Returns:
- The name of the authenticator.
-
isDisabled
boolean isDisabled()By default all the authenticators found in the system are enabled. Can use this property to control default behavior.- Returns:
trueif this authenticator is disabled, elsefalse.
-
getAuthenticationSkippingUrls
Gets a list of urls to skip authentication. Also see CarbonSecuredHttpContext.skipSSOSessionInvalidation for more information.- Returns:
- A list of urls to skip authentication.
-
getSessionValidationSkippingUrls
Gets a list of urls to skip session validation. Also see CarbonSecuredHttpContext.skipSSOSessionInvalidation for more information.- Returns:
- A list of urls to skip session validation.
-
skipLoginPage
boolean skipLoginPage()If Authenticator does not need to have login page - set this to true.- Returns:
-