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
FieldsModifier and TypeFieldDescriptionstatic final List<LogonProvider>
Logon provider list.static final String
SapViewer login techpass password.static final String
SapViewer login techsystem system.static final String
SapViewer login techuser.Fields inherited from class com.saperion.ngc.model.ClassicConnectorService
ddcCache
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new AuthClassicConnectorService.AuthClassicConnectorService
(ConnectionProvider<com.saperion.connector.SaClassicConnector> connectionProvider) Creates an AuthClassicConnectorService, given the connection provider .AuthClassicConnectorService
(ConnectionProvider<com.saperion.connector.SaClassicConnector> connectionProvider, jakarta.servlet.http.HttpSession session) Creates an AuthClassicConnectorService, given the connection provider .AuthClassicConnectorService
(jakarta.servlet.http.HttpSession session) Creates a new AuthClassicConnectorService. -
Method Summary
Modifier and TypeMethodDescriptionboolean
This function tries to automatic logon with SSO or NTLM.boolean
autoLogon
(com.saperion.connector.authentication.SessionInfo sessionInfo) This function tries to automatic logon with SSO or NTLM, passing the web session information.changePassword
(User user, String newPassword) Changes the password of the given user.boolean
closeSession
(com.saperion.connector.authentication.Session session) Close the givenSession
com.lexmark.saperion.administration.RoleType
final String
final SystemType
Get the system type.Get available user types.final ModelConnectionStatus
Check connection status.final void
logoff()
Logoff from service.final User
Logon to service.final User
Logon with a technical user.final User
Logon with a technical user.boolean
This method checks if aLogonProvider
is responsible of handling actions to be done after the user was logged out.void
setCurrentUserPresent
(boolean present) Sets whether the current user is present.void
setCurrentUserSubstituteAccessEnabled
(boolean accessEnabled) Sets whether the current user's substitute has access to the users workflow-inbox.final void
setLastUser
(String user) Sets the last user name.void
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 Details
-
SAPV_TECH_USER
SapViewer login techuser. userName.- See Also:
-
SAPV_TECH_PASS
SapViewer login techpass password.- See Also:
-
SAPV_TECH_SYSTEM
SapViewer login techsystem system.- See Also:
-
PROVIDER
Logon provider list.
-
-
Constructor Details
-
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(jakarta.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, jakarta.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 Details
-
logon
public final User logon(AuthenticationInformation info) throws AuthenticationException, SystemException Logon to service.- Specified by:
logon
in 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:
-
logonTech
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(String tenant, jakarta.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
Logoff from service.- Specified by:
logoff
in interfaceAuthorizationService
- Throws:
AuthenticationException
- authentication to the backend has failedDocumentLockException
- when a locked document could not be unlockedSystemException
- when logoff has failed- See Also:
-
getUserTypes
Get available user types.- Specified by:
getUserTypes
in interfaceAuthorizationService
- Returns:
- Usertypes
- See Also:
-
getSystemType
Get the system type.- Specified by:
getSystemType
in interfaceAuthorizationService
- Returns:
- System type
- Throws:
SystemException
- when the system type can not be determined- See Also:
-
autoLogon
This function tries to automatic logon with SSO or NTLM.- Specified by:
autoLogon
in 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:
-
autoLogon
public boolean autoLogon(com.saperion.connector.authentication.SessionInfo sessionInfo) throws AuthenticationException, SystemException This function tries to automatic logon with SSO or NTLM, passing the web session information.- Specified by:
autoLogon
in 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:
-
logoutHandledByLogonProvider
public boolean logoutHandledByLogonProvider()Description copied from interface:AuthorizationService
This method checks if aLogonProvider
is 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:
logoutHandledByLogonProvider
in interfaceAuthorizationService
- Returns:
- true if logout was handled by a LogonProvier
-
isConnected
Check connection status.- Specified by:
isConnected
in interfaceAuthorizationService
- Returns:
- Connection status
- Throws:
SystemException
- when the connection status can not be determined- See Also:
-
getLastUser
- Specified by:
getLastUser
in interfaceAuthorizationService
- Returns:
- last user name
-
setCurrentUserPresent
Sets whether the current user is present.- Specified by:
setCurrentUserPresent
in 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, AuthenticationException Sets whether the current user's substitute has access to the users workflow-inbox.- Specified by:
setCurrentUserSubstituteAccessEnabled
in 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
- Specified by:
getCurrentUser
in 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, String newPassword) throws SystemException, AuthenticationException Description copied from interface:AuthorizationService
Changes 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:
changePassword
in 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
Sets the last user name.- Specified by:
setLastUser
in interfaceAuthorizationService
- Parameters:
user
- last user name
-
setLocale
Sets the locale for the underlying connection to the backend. Does not change the locale of the client!- Specified by:
setLocale
in interfaceAuthorizationService
- Parameters:
locale
- locale to set- Throws:
AuthenticationException
- authentication exception when setting localeSystemException
- system exception when setting locale- See Also:
-
closeSession
public boolean closeSession(com.saperion.connector.authentication.Session session) throws AuthenticationException, SystemException Close the givenSession
- Specified by:
closeSession
in interfaceAuthorizationService
- Returns:
- true if successful, false otherwise
- Throws:
AuthenticationException
SystemException
- See Also:
-
getCurrentUserRole
public com.lexmark.saperion.administration.RoleType getCurrentUserRole() throws com.saperion.exception.SaAuthenticationException, com.saperion.exception.SaSystemException- Throws:
com.saperion.exception.SaAuthenticationException
com.saperion.exception.SaSystemException
-