public override Tag Initialize() { base.Initialize(); #if DEBUG Manager.Events.LogMessage(this, LogType.Debug, "Initializing SCRAM Processor"); Manager.Events.LogMessage(this, LogType.Debug, "Generating nonce"); #endif _nonce = NextInt64().ToString(); #if DEBUG Manager.Events.LogMessage(this, LogType.Debug, "Nonce: {0}", _nonce); Manager.Events.LogMessage(this, LogType.Debug, "Building Initial Message"); #endif var msg = new StringBuilder(); msg.Append("n,,n="); msg.Append(Id.User); msg.Append(",r="); msg.Append(_nonce); #if DEBUG Manager.Events.LogMessage(this, LogType.Debug, "Message: {0}", msg.ToString()); #endif _clientFirst = msg.ToString().Substring(3); tags.xmpp_sasl.auth tag = new tags.xmpp_sasl.auth(); tag.mechanism = MechanismType.SCRAM; tag.Bytes = _utf.GetBytes(msg.ToString()); return tag as tags.xmpp_sasl.auth; }
public override Tag Initialize() { #if DEBUG Manager.Events.LogMessage(this, LogType.Debug, "Initializing XOAUTH2 Processor"); Manager.Events.LogMessage(this, LogType.Debug, "ID User: {0}", Manager.Settings.Id); #endif string token = ""; tags.xmpp_sasl.auth authtag = new tags.xmpp_sasl.auth(); authtag.mechanism = MechanismType.XOAUTH2; XNamespace auth = "http://www.google.com/talk/protocol/auth"; authtag.Add(new XAttribute(XNamespace.Xmlns + "auth", "http://www.google.com/talk/protocol/auth")); authtag.Add(new XAttribute(auth + "service", "oauth2")); var sb = new StringBuilder(); sb.Append((char)0); sb.Append(Manager.Settings.Id); sb.Append((char)0); sb.Append(token); authtag.Value = Convert.ToBase64String(Encoding.UTF8.GetBytes(sb.ToString())); return(authtag as Tag); }
public override Tag Initialize() { #if DEBUG Manager.Events.LogMessage(this, LogType.Debug, "Initializing XOAUTH2 Processor"); Manager.Events.LogMessage(this, LogType.Debug, "ID User: {0}", Manager.Settings.Id); #endif string token = ""; tags.xmpp_sasl.auth authtag = new tags.xmpp_sasl.auth(); authtag.mechanism = MechanismType.XOAUTH2; XNamespace auth = "http://www.google.com/talk/protocol/auth"; authtag.Add(new XAttribute(XNamespace.Xmlns + "auth", "http://www.google.com/talk/protocol/auth")); authtag.Add(new XAttribute(auth + "service", "oauth2")); var sb = new StringBuilder(); sb.Append((char)0); sb.Append(Manager.Settings.Id); sb.Append((char)0); sb.Append(token); authtag.Value = Convert.ToBase64String(Encoding.UTF8.GetBytes(sb.ToString())); return authtag as Tag; }
public override Tag Initialize() { base.Initialize(); #if DEBUG Manager.Events.LogMessage(this, LogType.Debug, "Initializing SCRAM Processor"); Manager.Events.LogMessage(this, LogType.Debug, "Generating nonce"); #endif _nonce = NextInt64().ToString(); #if DEBUG Manager.Events.LogMessage(this, LogType.Debug, "Nonce: {0}", _nonce); Manager.Events.LogMessage(this, LogType.Debug, "Building Initial Message"); #endif var msg = new StringBuilder(); msg.Append("n,,n="); msg.Append(Id.User); msg.Append(",r="); msg.Append(_nonce); #if DEBUG Manager.Events.LogMessage(this, LogType.Debug, "Message: {0}", msg.ToString()); #endif _clientFirst = msg.ToString().Substring(3); tags.xmpp_sasl.auth tag = new tags.xmpp_sasl.auth(); tag.mechanism = MechanismType.SCRAM; tag.Bytes = _utf.GetBytes(msg.ToString()); return(tag as tags.xmpp_sasl.auth); }
public override Tag Initialize() { base.Initialize(); tags.xmpp_sasl.auth tag = new tags.xmpp_sasl.auth(); tag.mechanism = MechanismType.DigestMD5; return tag as tags.Tag; }
public override Tag Initialize() { base.Initialize(); tags.xmpp_sasl.auth tag = new tags.xmpp_sasl.auth(); tag.mechanism = MechanismType.DigestMD5; return(tag as tags.Tag); }
public override Tag Initialize() { #if DEBUG Manager.Events.LogMessage(this, LogType.Debug, "Initializing Plain Processor"); Manager.Events.LogMessage(this, LogType.Debug, "ID User: {0}", Manager.Settings.Id.User); #endif var sb = new StringBuilder(); sb.Append((char) 0); sb.Append(Manager.Settings.Id.User); sb.Append((char) 0); sb.Append(Manager.Settings.Password); tags.xmpp_sasl.auth auth = new tags.xmpp_sasl.auth(); auth.Value = Convert.ToBase64String(Encoding.UTF8.GetBytes(sb.ToString())); auth.mechanism = MechanismType.Plain; return auth as Tag; }
public override Tag Initialize() { #if DEBUG Manager.Events.LogMessage(this, LogType.Debug, "Initializing Plain Processor"); Manager.Events.LogMessage(this, LogType.Debug, "ID User: {0}", Manager.Settings.Id.User); #endif var sb = new StringBuilder(); sb.Append((char)0); sb.Append(Manager.Settings.Id.User); sb.Append((char)0); sb.Append(Manager.Settings.Password); tags.xmpp_sasl.auth auth = new tags.xmpp_sasl.auth(); auth.Value = Convert.ToBase64String(Encoding.UTF8.GetBytes(sb.ToString())); auth.mechanism = MechanismType.Plain; return(auth as Tag); }