Package org.wso2.carbon.ui
Interface CarbonUIAuthenticator
-
- All Known Implementing Classes:
AbstractCarbonUIAuthenticator,BasicAuthUIAuthenticator,DefaultCarbonAuthenticator
public interface CarbonUIAuthenticatorThis 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidauthenticate(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.List<String>getAuthenticationSkippingUrls()Gets a list of urls to skip authentication.StringgetAuthenticatorName()Returns the name of the authenticator.intgetPriority()Gets the authenticator priority.List<String>getSessionValidationSkippingUrls()Gets a list of urls to skip session validation.booleanisDisabled()By default all the authenticators found in the system are enabled.booleanskipLoginPage()If Authenticator does not need to have login page - set this to true.voidunauthenticate(Object object)Invalidates the authentication session.
-
-
-
Method Detail
-
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.AuthenticationExceptionAuthenticates 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.AuthenticationExceptionHandles 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
void unauthenticate(Object object) throws Exception
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
List<String> 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
List<String> 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:
-
-