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>
PROVIDER
Logon provider list.static java.lang.String
SAPV_TECH_PASS
SapViewer login techpass password.static java.lang.String
SAPV_TECH_SYSTEM
SapViewer login techsystem system.static java.lang.String
SAPV_TECH_USER
SapViewer 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 boolean
autoLogon()
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.User
changePassword(User user, java.lang.String newPassword)
Changes the password of the given user.boolean
closeSession(com.saperion.connector.authentication.Session session)
Close the givenSession
User
getCurrentUser()
com.lexmark.saperion.administration.RoleType
getCurrentUserRole()
java.lang.String
getLastUser()
SystemType
getSystemType()
Get the system type.java.util.List<UserType>
getUserTypes()
Get available user types.ModelConnectionStatus
isConnected()
Check connection status.void
logoff()
Logoff from service.User
logon(AuthenticationInformation info)
Logon to service.User
logonTech(java.lang.String tenant)
Logon with a technical user.User
logonTech(java.lang.String tenant, javax.servlet.http.HttpSession session)
Logon with a technical user.boolean
logoutHandledByLogonProvider()
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.void
setLastUser(java.lang.String user)
Sets the last user name.void
setLocale(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:
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:
(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, SystemException
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:
AuthorizationService.logoff()
-
getUserTypes
public final java.util.List<UserType> getUserTypes()
Get available user types.- Specified by:
getUserTypes
in interfaceAuthorizationService
- Returns:
- Usertypes
- See Also:
AuthorizationService.getUserTypes()
-
getSystemType
public final SystemType getSystemType() throws SystemException
Get the system type.- Specified by:
getSystemType
in interfaceAuthorizationService
- Returns:
- System type
- Throws:
SystemException
- when the system type can not be determined- See Also:
AuthorizationService.getSystemType()
-
autoLogon
public boolean autoLogon() throws AuthenticationException, SystemException
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:
AuthorizationService.autoLogon()
-
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:
AuthorizationService.autoLogon(SessionInfo)
-
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
public final ModelConnectionStatus isConnected() throws SystemException
Check connection status.- Specified by:
isConnected
in 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:
getLastUser
in interfaceAuthorizationService
- Returns:
- last user name
-
setCurrentUserPresent
public void setCurrentUserPresent(boolean present) throws SystemException, AuthenticationException
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
public User getCurrentUser() throws AuthenticationException, SystemException
- 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, java.lang.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
public final void setLastUser(java.lang.String user)
Sets the last user name.- Specified by:
setLastUser
in interfaceAuthorizationService
- Parameters:
user
- last user name
-
setLocale
public void setLocale(java.util.Locale locale) throws AuthenticationException, SystemException
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:
AuthorizationService.setLocale(java.util.Locale)
-
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:
AuthorizationService.closeSession(Session)
-
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
-
-