use of org.jivesoftware.openfire.sip.tester.security.UserCredentials in project Openfire by igniterealtime.
the class SipManager method startRegisterProcess.
public void startRegisterProcess(String userName, String authUserName, String password) throws CommunicationsException {
try {
checkIfStarted();
// Obtain initial credentials
String realm = SIPConfig.getAuthenticationRealm();
realm = realm == null ? "" : realm;
// put the returned user name in the properties file
// so that it appears as a default one next time user is prompted
// for pass
SIPConfig.setUserName(userName);
SIPConfig.setAuthUserName(authUserName);
UserCredentials initialCredentials = new UserCredentials();
initialCredentials.setUserName(userName);
initialCredentials.setAuthUserName(authUserName);
initialCredentials.setPassword(password.toCharArray());
register(initialCredentials.getUserName() + "@" + realm);
// at this point a simple register request has been sent and the
// global
// from header in SipManager has been set to a valid value by the
// RegisterProcesing
// class. Use it to extract the valid user name that needs to be
// cached by
// the security manager together with the user provided password.
initialCredentials.setUserName(((SipURI) getFromHeader().getAddress().getURI()).getUser());
// JOptionPane.showMessageDialog(null,( (SipURI)
// getFromHeader().getAddress().getURI()).getUser());
cacheCredentials(realm, initialCredentials);
} catch (Exception ee) {
Log.error("startRegisterProcess", ee);
}
}
Aggregations