if (session == null) {
return;
} // end of if (session == null)
Element request = packet.getElement();
// ElementType type = null;
// try {
// type = ElementType.valueOf(request.getName());
// } catch (IllegalArgumentException e) {
// log.warning("Incorrect stanza type: " + request.getName());
// results.offer(packet.swapFromTo(createReply(ElementType.failure,
// "<temporary-auth-failure/>")));
// results.offer(Command.CLOSE.getPacket(packet.getTo(), packet.getFrom(),
// StanzaType.set, packet.getElemId()));
// return;
// } // end of try-catch
Map<String, Object> authProps =
(Map<String, Object>)(session.getSessionData(XMLNS+"-authProps"));
if (authProps == null) {
authProps = new HashMap<String, Object>();
authProps.put(UserAuthRepository.PROTOCOL_KEY,
UserAuthRepository.PROTOCOL_VAL_SASL);
authProps.put(UserAuthRepository.MACHANISM_KEY,
request.getAttribute("/auth", "mechanism"));
authProps.put(UserAuthRepository.REALM_KEY, session.getDomain());
authProps.put(UserAuthRepository.SERVER_NAME_KEY, session.getDomain());
session.putSessionData(XMLNS+"-authProps", authProps);
} // end of if (authProps == null)
// String user = (String)authProps.get(UserAuthRepository.USER_ID_KEY);
authProps.put(UserAuthRepository.DATA_KEY, request.getCData());
try {
Authorization result = session.loginOther(authProps);
String challenge_data =
(String)authProps.get(UserAuthRepository.RESULT_KEY);
if (result == Authorization.AUTHORIZED) {