public interface SecurityMgrIf
Modifier and Type | Method and Description |
---|---|
void |
addCustomDataToSession(java.lang.String sessionId,
java.lang.String data,
int position)
A sessionId is created when a customer logs in to KonaKart using the login() API call.
|
void |
changePassword(java.lang.String sessionId,
java.lang.String currentPassword,
java.lang.String newPassword)
The method ensures that the current password is correct, and then changes it with the new
password.
|
int |
checkAdminSession(java.lang.String adminSession,
int customerId)
If the session of the admin user is valid and refers to an administrator then the id of the
admin user is returned.
|
void |
checkFileAccess(java.lang.String fileName)
Check that we allow access to this location.
|
int |
checkSession(java.lang.String sessionId)
The given sessionId is checked to see whether it exists and whether it is has timed out.
|
void |
enableCustomer(java.lang.String secretKey)
This method retrieves the SSO token using the Secret Key.
|
java.lang.String |
encrypt(java.lang.String password)
Returns an encrypted password.
|
ExternalLoginResult |
externalLogin(ExternalLoginInputIf loginInfo)
Used for logging in customers using a mechanism outside of KonaKart such as social login
using Facebook.
|
java.lang.String |
getCustomDataFromSession(java.lang.String sessionId,
int position)
A sessionId is created when a customer logs in to KonaKart using the login() API call.
|
java.lang.String |
getRandomPassword(int length)
If length == 0, the configuration value ENTRY_PASSWORD_MIN_LENGTH is used.
|
SSOTokenIf |
getSSOToken(java.lang.String secretKey,
boolean deleteToken)
Returns an SSOToken object for the secretKey (UUID).
|
int |
getTimeInSecs()
Utility method to return the current time in seconds
|
java.lang.String |
login(int customerId)
Login method that assumes that all checks have already been taken.
|
java.lang.String |
login(java.lang.String emailAddr,
java.lang.String password)
Returns a session id if successful.
|
java.lang.String |
loginByAdmin(java.lang.String adminSession,
int customerId)
Used to log in to the application as a customer by an Administrator.
|
LoginResult |
loginWithOptions(LoginInputIf input)
Returns a LoginResult object containing the result of the login.
|
void |
logout(java.lang.String sessionId)
Logout the user with the specified session Id.
|
void |
refreshConfigs()
Refresh the configuration of the Security Manager
|
java.lang.String |
saveSSOToken(SSOTokenIf token)
Saves the SSOToken in the database and returns a UUID secret key identifier.
|
void |
sendNewPassword(java.lang.String emailAddr,
java.lang.String subject,
java.lang.String countryCode)
Deprecated.
|
EmailIf |
sendNewPassword1(java.lang.String emailAddr,
EmailOptionsIf options)
If a customer exists with the email address passed in as a parameter, then a new password is
generated and sent to the customer.
|
void |
setNewPassword(java.lang.String adminSession,
java.lang.String customerEmailAddr,
int customerId,
java.lang.String newPassword)
Used to change the password of a customer.
|
CaptchaResultIf |
validateCaptcha(CaptchaInputIf captchaInfo)
Used for validate captcha
|
boolean |
validatePassword(java.lang.String sessionId,
java.lang.String password)
This method validates the password of a logged in customer and can be used to force the
customer to enter his password before allowing certain actions like the modification of the
customer's email address.
|
java.lang.String login(java.lang.String emailAddr, java.lang.String password) throws java.lang.Exception
emailAddr
- the emailAddrpassword
- the passwordjava.lang.Exception
- an unexpected exceptionLoginResult loginWithOptions(LoginInputIf input) throws java.lang.Exception
input
- LoginInput object containing the username and passwordjava.lang.Exception
- an unexpected exceptionjava.lang.String login(int customerId) throws java.lang.Exception
customerId
- the customerIdjava.lang.Exception
- an unexpected exceptionvoid logout(java.lang.String sessionId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, com.konakart.app.KKException
sessionId
- the sessionIdcom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.konakart.app.KKException
- an unexpected KKException exceptionint getTimeInSecs()
int checkSession(java.lang.String sessionId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, com.konakart.app.KKException
sessionId
- the sessionIdorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)com.konakart.app.KKException
- an unexpected KKException exceptionjava.lang.String encrypt(java.lang.String password) throws java.security.NoSuchAlgorithmException
password
- the passwordjava.security.NoSuchAlgorithmException
- an unexpected NoSuchAlgorithmException exceptionvoid changePassword(java.lang.String sessionId, java.lang.String currentPassword, java.lang.String newPassword) throws java.lang.Exception
sessionId
- the sessionIdcurrentPassword
- the currentPasswordnewPassword
- the newPasswordjava.lang.Exception
- an unexpected exceptionjava.lang.String getRandomPassword(int length) throws java.lang.Exception
length
- the lengthjava.lang.Exception
- an unexpected exception@Deprecated void sendNewPassword(java.lang.String emailAddr, java.lang.String subject, java.lang.String countryCode) throws java.security.NoSuchAlgorithmException, java.lang.Exception
emailAddr
- the emailAddrsubject
- the subjectcountryCode
- the countryCodejava.security.NoSuchAlgorithmException
- an unexpected NoSuchAlgorithmException exceptionjava.lang.Exception
- an unexpected exceptionEmailIf sendNewPassword1(java.lang.String emailAddr, EmailOptionsIf options) throws java.security.NoSuchAlgorithmException, java.lang.Exception
emailAddr
- the emailAddroptions
- the optionsjava.security.NoSuchAlgorithmException
- an unexpected NoSuchAlgorithmException exceptionjava.lang.Exception
- an unexpected exceptionjava.lang.String loginByAdmin(java.lang.String adminSession, int customerId) throws java.lang.Exception
adminSession
- The session of a logged in administrator usercustomerId
- The id of the customer to login asjava.lang.Exception
- an unexpected exceptionvoid addCustomDataToSession(java.lang.String sessionId, java.lang.String data, int position) throws org.apache.torque.TorqueException, com.konakart.app.KKException
sessionId
- The sessionIddata
- The data to be savedposition
- This must be in the range of 1-5 to identify custom1 to custom5org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.konakart.app.KKException
- an unexpected KKException exceptionjava.lang.String getCustomDataFromSession(java.lang.String sessionId, int position) throws com.konakart.app.KKException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
sessionId
- The sessionIdposition
- This must be in the range of 1-5 to identify custom1 to custom5com.konakart.app.KKException
- an unexpected KKException exceptionorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)java.lang.String saveSSOToken(SSOTokenIf token) throws java.lang.Exception
token
- The SSO token to be savedjava.lang.Exception
- an unexpected exceptionSSOTokenIf getSSOToken(java.lang.String secretKey, boolean deleteToken) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
deleteToken
parameter is set to true, the token is deleted from the
database after having been read.secretKey
- The UUID secretKey used to identify the tokendeleteToken
- The token is deleted from the database after being readorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)void enableCustomer(java.lang.String secretKey) throws java.lang.Exception
If the custom1
attribute of the SSO token object is set to true
then the emailVerified
attribute of the customer is also set.
secretKey
- the secretKeyjava.lang.Exception
- an unexpected exceptionboolean validatePassword(java.lang.String sessionId, java.lang.String password) throws java.lang.Exception
The method returns true if the password validates against the session. If either the session is invalid or the password and session don't match, then the method returns false.
sessionId
- the sessionIdpassword
- the passwordjava.lang.Exception
- an unexpected exceptionExternalLoginResult externalLogin(ExternalLoginInputIf loginInfo) throws java.lang.Exception
com.konakart.bl.modules.others.ExternalLoginInterface
) must be present in the
system and must have been installed and activated.
The function of this method is to instantiate the module, to call its
externalLogin
method and to return the result from the module which should
contain a KonaKart sessionId if the login was successful.
loginInfo
- Contains the information required by the module to perform the loginjava.lang.Exception
- an unexpected exceptionint checkAdminSession(java.lang.String adminSession, int customerId) throws java.lang.Exception
adminSession
- Session of the admin usercustomerId
- Used when the admin user is of type CUST_TYPE_B2B_COMPANY_ADMIN to ensure that the
customer the admin user is logging in for, is actually a child of the admin userjava.lang.Exception
- an unexpected exceptionvoid setNewPassword(java.lang.String adminSession, java.lang.String customerEmailAddr, int customerId, java.lang.String newPassword) throws java.lang.Exception
For security purposes, the session id of a KonaKart administrator must be passed in as a parameter. This session id is checked to ensure that it applies to a logged in administrator.
If customerEmailAddr
is set then the customer is looked up from the email
address. Otherwise the customerId is used to look up the customer. If the customer isn't
found, an exception is thrown.
adminSession
- The session id of an administratorcustomerEmailAddr
- The email address of the customercustomerId
- The id of the customer. Only used if customerEmailAddr is nullnewPassword
- The new passwordjava.lang.Exception
- an unexpected exceptionvoid checkFileAccess(java.lang.String fileName) throws java.lang.Exception
fileName
- the file to be accessed (read or written)java.lang.Exception
- an unexpected exception
if access to the filepath isn't permitted an Exception is thrown otherwise the
method returns successfully.void refreshConfigs() throws com.konakart.app.KKException
com.konakart.app.KKException
- unexpected exception in the KonaKart Storefront EngineCaptchaResultIf validateCaptcha(CaptchaInputIf captchaInfo) throws java.lang.Exception
captchaInfo
- Contains the information required by the module to perform the validationjava.lang.Exception
- an unexpected exceptionCopyright © 2018 DS Data Systems UK Ltd.