Class AuthClassicConnectorService
- java.lang.Object
-
- com.saperion.ngc.model.ClassicConnectorService
-
- com.saperion.ngc.model.authorization.AuthClassicConnectorService
-
- All Implemented Interfaces:
AuthorizationService,Service
public class AuthClassicConnectorService extends ClassicConnectorService implements AuthorizationService
Classic connector based authentication service class.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<LogonProvider>PROVIDERLogon provider list.static java.lang.StringSAPV_TECH_PASSSapViewer login techpass password.static java.lang.StringSAPV_TECH_SYSTEMSapViewer login techsystem system.static java.lang.StringSAPV_TECH_USERSapViewer login techuser.-
Fields inherited from class com.saperion.ngc.model.ClassicConnectorService
ddcCache
-
-
Constructor Summary
Constructors Constructor Description AuthClassicConnectorService()Creates a new AuthClassicConnectorService.AuthClassicConnectorService(ConnectionProvider<com.saperion.connector.SaClassicConnector> connectionProvider)Creates an AuthClassicConnectorService, given the connection provider .AuthClassicConnectorService(ConnectionProvider<com.saperion.connector.SaClassicConnector> connectionProvider, javax.servlet.http.HttpSession session)Creates an AuthClassicConnectorService, given the connection provider .AuthClassicConnectorService(javax.servlet.http.HttpSession session)Creates a new AuthClassicConnectorService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanautoLogon()This function tries to automatic logon with SSO or NTLM.booleanautoLogon(com.saperion.connector.authentication.SessionInfo sessionInfo)This function tries to automatic logon with SSO or NTLM, passing the web session information.UserchangePassword(User user, java.lang.String newPassword)Changes the password of the given user.booleancloseSession(com.saperion.connector.authentication.Session session)Close the givenSessionUsergetCurrentUser()com.lexmark.saperion.administration.RoleTypegetCurrentUserRole()java.lang.StringgetLastUser()SystemTypegetSystemType()Get the system type.java.util.List<UserType>getUserTypes()Get available user types.ModelConnectionStatusisConnected()Check connection status.voidlogoff()Logoff from service.Userlogon(AuthenticationInformation info)Logon to service.UserlogonTech(java.lang.String tenant)Logon with a technical user.UserlogonTech(java.lang.String tenant, javax.servlet.http.HttpSession session)Logon with a technical user.booleanlogoutHandledByLogonProvider()This method checks if aLogonProvideris responsible of handling actions to be done after the user was logged out.voidsetCurrentUserPresent(boolean present)Sets whether the current user is present.voidsetCurrentUserSubstituteAccessEnabled(boolean accessEnabled)Sets whether the current user's substitute has access to the users workflow-inbox.voidsetLastUser(java.lang.String user)Sets the last user name.voidsetLocale(java.util.Locale locale)Sets the locale for the underlying connection to the backend.-
Methods inherited from class com.saperion.ngc.model.ClassicConnectorService
convertAuthenticationException, getCachedDDC, getConnectionProvider, getCurrentUserFromSession, getSession, getWfConnectionProvider, isActive
-
-
-
-
Field Detail
-
SAPV_TECH_USER
public static final java.lang.String SAPV_TECH_USER
SapViewer login techuser. userName.- See Also:
- Constant Field Values
-
SAPV_TECH_PASS
public static final java.lang.String SAPV_TECH_PASS
SapViewer login techpass password.- See Also:
- Constant Field Values
-
SAPV_TECH_SYSTEM
public static final java.lang.String SAPV_TECH_SYSTEM
SapViewer login techsystem system.- See Also:
- Constant Field Values
-
PROVIDER
public static final java.util.List<LogonProvider> PROVIDER
Logon provider list.
-
-
Constructor Detail
-
AuthClassicConnectorService
public AuthClassicConnectorService()
Creates a new AuthClassicConnectorService.
-
AuthClassicConnectorService
public AuthClassicConnectorService(ConnectionProvider<com.saperion.connector.SaClassicConnector> connectionProvider)
Creates an AuthClassicConnectorService, given the connection provider .- Parameters:
connectionProvider- the connection provider
-
AuthClassicConnectorService
public AuthClassicConnectorService(javax.servlet.http.HttpSession session)
Creates a new AuthClassicConnectorService. Use this constructor when using this auth-service from outside of ZK-context (e.g. in a servlet).- Parameters:
session- the session to use in this auth-service
-
AuthClassicConnectorService
public AuthClassicConnectorService(ConnectionProvider<com.saperion.connector.SaClassicConnector> connectionProvider, javax.servlet.http.HttpSession session)
Creates an AuthClassicConnectorService, given the connection provider . Use this constructor when using this auth-service from outside of ZK-context (e.g. in a servlet).- Parameters:
connectionProvider- the connection providersession- the session to use in this auth-service
-
-
Method Detail
-
logon
public final User logon(AuthenticationInformation info) throws AuthenticationException, SystemException
Logon to service.- Specified by:
logonin interfaceAuthorizationService- Parameters:
info- authentication information- Returns:
- the currently logged on user
- Throws:
AuthenticationException- when authentication to the backend has failedSystemException- system exception when logging on- See Also:
(com.saperion.ngc.model.authorization.User)
-
logonTech
public final User logonTech(java.lang.String tenant) throws AuthenticationException, SystemException
Logon with a technical user.- Parameters:
tenant- Mandant- Returns:
- User instance or null, if failed.
- Throws:
AuthenticationException- Authentication failedSystemException- System failure
-
logonTech
public final User logonTech(java.lang.String tenant, javax.servlet.http.HttpSession session) throws AuthenticationException, SystemException
Logon with a technical user.- Parameters:
tenant- Mandantsession- the current session- Returns:
- User instance or null, if failed.
- Throws:
AuthenticationException- Authentication failedSystemException- System failure
-
logoff
public final void logoff() throws AuthenticationException, DocumentLockException, SystemExceptionLogoff from service.- Specified by:
logoffin interfaceAuthorizationService- Throws:
AuthenticationException- authentication to the backend has failedDocumentLockException- when a locked document could not be unlockedSystemException- when logoff has failed- See Also:
AuthorizationService.logoff()
-
getUserTypes
public final java.util.List<UserType> getUserTypes()
Get available user types.- Specified by:
getUserTypesin interfaceAuthorizationService- Returns:
- Usertypes
- See Also:
AuthorizationService.getUserTypes()
-
getSystemType
public final SystemType getSystemType() throws SystemException
Get the system type.- Specified by:
getSystemTypein interfaceAuthorizationService- Returns:
- System type
- Throws:
SystemException- when the system type can not be determined- See Also:
AuthorizationService.getSystemType()
-
autoLogon
public boolean autoLogon() throws AuthenticationException, SystemExceptionThis function tries to automatic logon with SSO or NTLM.- Specified by:
autoLogonin interfaceAuthorizationService- Returns:
- true, if automatic logon could be used, false, if no automatic data is set!
- Throws:
AuthenticationException- when authentication to the backend has failedSystemException- system exception when logging on- See Also:
AuthorizationService.autoLogon()
-
autoLogon
public boolean autoLogon(com.saperion.connector.authentication.SessionInfo sessionInfo) throws AuthenticationException, SystemExceptionThis function tries to automatic logon with SSO or NTLM, passing the web session information.- Specified by:
autoLogonin interfaceAuthorizationService- Parameters:
sessionInfo- The web session information- Returns:
- true, if automatic logon could be used, false, if no automatic data is set!
- Throws:
AuthenticationException- when authentication to the backend has failedSystemException- system exception when logging on- See Also:
AuthorizationService.autoLogon(SessionInfo)
-
logoutHandledByLogonProvider
public boolean logoutHandledByLogonProvider()
Description copied from interface:AuthorizationServiceThis method checks if aLogonProvideris responsible of handling actions to be done after the user was logged out. If a responsible provider is found, it's logout method will be called and this method will return true.- Specified by:
logoutHandledByLogonProviderin interfaceAuthorizationService- Returns:
- true if logout was handled by a LogonProvier
-
isConnected
public final ModelConnectionStatus isConnected() throws SystemException
Check connection status.- Specified by:
isConnectedin interfaceAuthorizationService- Returns:
- Connection status
- Throws:
SystemException- when the connection status can not be determined- See Also:
AuthorizationService.isConnected()
-
getLastUser
public final java.lang.String getLastUser()
- Specified by:
getLastUserin interfaceAuthorizationService- Returns:
- last user name
-
setCurrentUserPresent
public void setCurrentUserPresent(boolean present) throws SystemException, AuthenticationExceptionSets whether the current user is present.- Specified by:
setCurrentUserPresentin interfaceAuthorizationService- Parameters:
present- whether the current user is present- Throws:
SystemException- when a system exception while setting presence occursAuthenticationException- when authentication to the backend has failed
-
setCurrentUserSubstituteAccessEnabled
public void setCurrentUserSubstituteAccessEnabled(boolean accessEnabled) throws SystemException, AuthenticationExceptionSets whether the current user's substitute has access to the users workflow-inbox.- Specified by:
setCurrentUserSubstituteAccessEnabledin interfaceAuthorizationService- Parameters:
accessEnabled- whether the substitute has access- Throws:
SystemException- when a system exception while setting presence occursAuthenticationException- when authentication to the backend has failed
-
getCurrentUser
public User getCurrentUser() throws AuthenticationException, SystemException
- Specified by:
getCurrentUserin interfaceAuthorizationService- Returns:
- Information about the currently logged in User. The instance obtained will not contain information about the authorization (getAuthenticationInformation() will return null).
- Throws:
AuthenticationException- when authentication to the backend has failedSystemException- when a system exception while obtaining the information occurs
-
changePassword
public User changePassword(User user, java.lang.String newPassword) throws SystemException, AuthenticationException
Description copied from interface:AuthorizationServiceChanges the password of the given user. The authentication information of the user needs to be given. This means that the password of the user has to be known.- Specified by:
changePasswordin interfaceAuthorizationService- Parameters:
user- The user to change the password for. If the authentication information is not given, the call will fail, since the current password is needed to succeed.newPassword- The new password for the user- Returns:
- updated user information
- Throws:
SystemException- when a system exception while obtaining the information occursAuthenticationException- when authentication to the backend has failed
-
setLastUser
public final void setLastUser(java.lang.String user)
Sets the last user name.- Specified by:
setLastUserin interfaceAuthorizationService- Parameters:
user- last user name
-
setLocale
public void setLocale(java.util.Locale locale) throws AuthenticationException, SystemExceptionSets the locale for the underlying connection to the backend. Does not change the locale of the client!- Specified by:
setLocalein interfaceAuthorizationService- Parameters:
locale- locale to set- Throws:
AuthenticationException- authentication exception when setting localeSystemException- system exception when setting locale- See Also:
AuthorizationService.setLocale(java.util.Locale)
-
closeSession
public boolean closeSession(com.saperion.connector.authentication.Session session) throws AuthenticationException, SystemExceptionClose the givenSession- Specified by:
closeSessionin interfaceAuthorizationService- Returns:
- true if successful, false otherwise
- Throws:
AuthenticationExceptionSystemException- See Also:
AuthorizationService.closeSession(Session)
-
getCurrentUserRole
public com.lexmark.saperion.administration.RoleType getCurrentUserRole() throws com.saperion.exception.SaAuthenticationException, com.saperion.exception.SaSystemException- Throws:
com.saperion.exception.SaAuthenticationExceptioncom.saperion.exception.SaSystemException
-
-