Package org.adempiere.base.sso
Interface ISSOPrincipalService
public interface ISSOPrincipalService
Single sign on service interface
- Author:
- Logilite Technologies
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getAuthenticationToken
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String redirectMode) Get the token by authentication code and save in the session attribute SSO_PRINCIPAL_SESSION_TOKENgetLanguage
(Object token) Return login Language from a tokendefault String
Get logout urlgetUserName
(Object token) Return user name/ email from a token.boolean
hasAuthenticationCode
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Check the request has an authentication codeboolean
isAuthenticated
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Check the request session attribute SSO_PRINCIPAL_SESSION_TOKEN has tokenvoid
redirectForAuthentication
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String redirectMode) Redirect to SSO authentication/login pagevoid
removePrincipalFromSession
(javax.servlet.http.HttpServletRequest request) Remove all SSO-related attributes from the session.
-
Field Details
-
SSO_PRINCIPAL_SESSION_TOKEN
- See Also:
-
SSO_QUERY_STRING
- See Also:
-
SSO_ADMIN_LOGIN
- See Also:
-
-
Method Details
-
hasAuthenticationCode
boolean hasAuthenticationCode(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Check the request has an authentication code- Parameters:
request
- HttpServletRequestresponse
- HttpServletResponse- Returns:
-
getAuthenticationToken
void getAuthenticationToken(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String redirectMode) throws Throwable Get the token by authentication code and save in the session attribute SSO_PRINCIPAL_SESSION_TOKEN- Parameters:
request
- HttpServletRequestresponse
- HttpServletResponseredirectMode
- "SSO_MODE_WEBUI", "SSO_MODE_OSGI", "SSO_MODE_MONITOR"- Throws:
Throwable
-
isAuthenticated
boolean isAuthenticated(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Check the request session attribute SSO_PRINCIPAL_SESSION_TOKEN has token- Parameters:
request
- HttpServletRequestresponse
- HttpServletResponse- Returns:
-
redirectForAuthentication
void redirectForAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String redirectMode) throws IOException Redirect to SSO authentication/login page- Parameters:
request
- HttpServletRequestresponse
- HttpServletResponseredirectMode
- "SSO_MODE_WEBUI", "SSO_MODE_OSGI", "SSO_MODE_MONITOR"- Throws:
IOException
-
removePrincipalFromSession
void removePrincipalFromSession(javax.servlet.http.HttpServletRequest request) Remove all SSO-related attributes from the session.- Parameters:
request
- HttpServletRequest
-
getUserName
Return user name/ email from a token.- Parameters:
token
- authentication token- Returns:
- User Name/email
- Throws:
ParseException
-
getLanguage
Return login Language from a token- Parameters:
token
- authentication token- Returns:
- Login Language
- Throws:
ParseException
-
getLogoutURL
Get logout url- Returns:
- logout url or null
-