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 StringSapViewer login techpass password.static final StringSapViewer login techsystem system.static final StringSapViewer 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 TypeMethodDescriptionbooleanThis 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.changePassword(User user, String newPassword) Changes the password of the given user.booleancloseSession(com.saperion.connector.authentication.Session session) Close the givenSessioncom.lexmark.saperion.administration.RoleTypefinal Stringfinal SystemTypeGet the system type.Get available user types.final ModelConnectionStatusCheck connection status.final voidlogoff()Logoff from service.final UserLogon to service.final UserLogon with a technical user.final UserLogon with a technical user.booleanThis 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.final voidsetLastUser(String user) Sets the last user name.voidSets 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:
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:
-
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:
logoffin 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:
getUserTypesin interfaceAuthorizationService- Returns:
- Usertypes
- See Also:
-
getSystemType
Get the system type.- Specified by:
getSystemTypein 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:
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:
-
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:
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:
-
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
Check connection status.- Specified by:
isConnectedin interfaceAuthorizationService- Returns:
- Connection status
- Throws:
SystemException- when the connection status can not be determined- See Also:
-
getLastUser
- Specified by:
getLastUserin interfaceAuthorizationService- Returns:
- last user name
-
setCurrentUserPresent
Sets 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, AuthenticationException Sets 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
- 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, 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
Sets the last user name.- Specified by:
setLastUserin 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:
setLocalein 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:
closeSessionin interfaceAuthorizationService- Returns:
- true if successful, false otherwise
- Throws:
AuthenticationExceptionSystemException- See Also:
-
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
-