public class EcRemoteIdentityManager extends Object implements RemoteIdentityManagerInterface
Requires initialization with server specific salts. Server specific salts prevent co-occurrence attacks, should credentials on one server be compromised (intercepted in transit).
Transmits hashed username, hashed password, and encrypts credentials using the hashed combination of the username and password. This prevents the system storing the credentials from having any knowledge of the user.
Password recovery is done by, when the password changes, creating a cryptographic pad (or perfect cipher) where one half is stored on the server, and the other half is stored with the user. Should the user lose this pad and forget their password, they are not able to recover or reset their password, and their data should be considered lost.
| Modifier and Type | Field and Description |
|---|---|
Boolean |
global |
protected String |
pad |
protected String |
passwordWithSalt |
protected String |
secretWithSalt |
String |
server |
protected String |
token |
protected String |
usernameWithSalt |
| Constructor and Description |
|---|
EcRemoteIdentityManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
changePassword(String username,
String oldPassword,
String newPassword)
Change password of user in memory.
|
void |
clear()
Wipes login data.
|
void |
commit(org.stjs.javascript.functions.Callback1<String> success,
org.stjs.javascript.functions.Callback1<String> failure)
Commits credentials in EcIdentityManager to remote server.
|
void |
configure(String usernameSalt,
int usernameIterations,
int usernameWidth,
String passwordSalt,
int passwordIterations,
int passwordWidth,
String secretSalt,
int secretIterations)
Configure parameters of the remote login storage.
|
void |
configureFromServer(org.stjs.javascript.functions.Callback1<Object> success,
org.stjs.javascript.functions.Callback1<String> failure)
Configures parameters of the remote server by accessing configuration details via webservice
|
void |
create(org.stjs.javascript.functions.Callback1<String> success,
org.stjs.javascript.functions.Callback1<String> failure)
Creates an account.
|
void |
fetch(org.stjs.javascript.functions.Callback1<Object> success,
org.stjs.javascript.functions.Callback1<String> failure)
Fetch credentials from server, invoking events based on login success or
failure.
|
Boolean |
isGlobal()
Returns true if the identity manager is global.
|
void |
setDefaultIdentityManagementServer(String server)
Configure compatible remote identity management server.
|
String |
splicePasswords(org.stjs.javascript.Array<String> passwords)
Splices together passwords (in a fashion more like shuffling a deck of
cards, not appending).
|
void |
startLogin(String username,
String password)
"Log Into" system, generating credentials.
|
public String server
public Boolean global
protected String usernameWithSalt
protected String passwordWithSalt
protected String secretWithSalt
protected String pad
protected String token
public Boolean isGlobal()
isGlobal in interface RemoteIdentityManagerInterfacepublic void configure(String usernameSalt, int usernameIterations, int usernameWidth, String passwordSalt, int passwordIterations, int passwordWidth, String secretSalt, int secretIterations)
configure in interface RemoteIdentityManagerInterface{String} - usernameSalt
Salt used in hashing the username.{int} - usernameIterations
Number of times to hash the username.{int} - usernameWidth
Resultant width of username in bytes.{String} - passwordSalt
Salt used to hash password.{int} - passwordIterations
Number of times to hash password.{int} - passwordWidth
Resultant width of password in bytes.{String} - secretSalt
Salt used to hash secret (composed of username + password){int} - secretIterations
Number of times to hash secret.public void configureFromServer(org.stjs.javascript.functions.Callback1<Object> success, org.stjs.javascript.functions.Callback1<String> failure)
configureFromServer in interface RemoteIdentityManagerInterface{Callback1 - success
Callback triggered after successfully configured{Callback1} - failure
Callback triggered if an error during failurepublic void clear()
clear in interface RemoteIdentityManagerInterfacepublic void setDefaultIdentityManagementServer(String server)
setDefaultIdentityManagementServer in interface RemoteIdentityManagerInterface{String} - server
URL to remote identity management server.public void startLogin(String username, String password)
Please clear username and password fields after this function is called.
startLogin in interface RemoteIdentityManagerInterface{String} - username
Username to login with{String} - password
Password to authenticate username withpublic boolean changePassword(String username, String oldPassword, String newPassword)
Please clear username and password fields after this function is called.
changePassword in interface RemoteIdentityManagerInterface{String} - username
Username{String} - oldPassword
Current password{String} - newPassword
Desired passwordpublic void fetch(org.stjs.javascript.functions.Callback1<Object> success, org.stjs.javascript.functions.Callback1<String> failure)
Automatically populates EcIdentityManager.
Requires login().
fetch in interface RemoteIdentityManagerInterface{Callback1 - success{Callback1} - failurepublic void commit(org.stjs.javascript.functions.Callback1<String> success, org.stjs.javascript.functions.Callback1<String> failure)
Will trigger pad generation and fail if the pad has not been specified.
commit in interface RemoteIdentityManagerInterface{Callback1} - success{Callback1} - failurepublic void create(org.stjs.javascript.functions.Callback1<String> success, org.stjs.javascript.functions.Callback1<String> failure)
Please note that the remote login server does not throw error messages if an account creation is blocked due to being a duplicate. This prevents login probing. This will always succeed (if the request is properly formed and makes it to the server).
Will trigger pad generation and fail if the pad has not been specified.
create in interface RemoteIdentityManagerInterface{Callback1} - success
Callback triggered after successfully creating an account{Callback1} - failure
Callback triggered if error creating an accountCopyright © 2018 Eduworks Corporation. All rights reserved.