Giter Club home page Giter Club logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
Apparently, this never worked with SASL.  What sort of action are you going to 
take
in OnLoginRequired?  I'm trying to picture the use case so I can figure out how 
the
API should change.  I guess I could add a new state, and make the Login() method
start the SASL process when you're in that state.

Original comment by [email protected] on 31 Mar 2008 at 8:18

from jabber-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
What I am looking to do is simply register a user.  This is within a welcome 
screen that prompts the user to create an account.  Looking into the issue 
further:

If username and password are null, then this happens:

SND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" 
id="cd16dc41" xmlns="jabber:client" to="robbiehanson.com" version="1.0">
Warning: overriding existing packet factory
RCV: <?xml version='1.0'?><stream:stream xmlns='jabber:client' 
xmlns:stream='http://etherx.jabber.org/streams' id='1490986094' 
from='robbiehanson.com' version='1.0' xml:lang='en'>
RCV: <stream:features><mechanisms 
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mecha
nism>PLAIN</mechanism></mechanisms><register 
xmlns='http://jabber.org/features/iq-
register'/></stream:features>
SND: <auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
RCV: <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>...</challenge>
jabberClient_OnError: jabber.connection.sasl.SASLException: Missing SASL 
username directive

Now if we check for a SASLException in the OnError method, and call Register at 
this point, we get an infinite loop:

[...the same stream opening sequence and features as above...]
SND: <auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
RCV: <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>...</challenge>
jabberClient_OnError: jabber.connection.sasl.SASLException: Missing SASL 
username directive
SND: <iq id="JN_1" type="get" to="robbiehanson.com"><query 
xmlns="jabber:iq:register"><username>johndoe</username></query></iq>
RCV: <iq from='robbiehanson.com' id='JN_1' type='result'><query 
xmlns='jabber:iq:register'><instructions>...</instructions><username/><password/
></query></iq>
jabberClient_OnError: jabber.connection.sasl.SASLException: Invalid SASL 
protocol
SND: <iq id="JN_2" type="get" to="robbiehanson.com"><query 
xmlns="jabber:iq:register"><username>johndoe</username></query></iq>
RCV: <iq from='robbiehanson.com' id='JN_2' type='result'><query 
xmlns='jabber:iq:register'><instructions>...</instructions><username/><password/
></query></iq>
jabberClient_OnError: jabber.connection.sasl.SASLException: Invalid SASL 
protocol
...etc

Now if we instead use an empty string for both username and password, then we 
get this:

[...the same stream opening sequence and features as above...]
SND: <auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
RCV: <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>...</challenge>
SND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">...</response>
RCV: <failure 
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure>
jabberClient_OnError: jabber.connection.sasl.AuthenticationFailedException: 
<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /></failure>

And registering at this point will work correctly:

[...the same stream opening sequence and features as above...]
SND: <auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
RCV: <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>...</challenge>
SND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">...</response>
RCV: <failure 
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure>
jabberClient_OnError: jabber.connection.sasl.AuthenticationFailedException: 
<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /></failure>
SND: <iq id="JN_1" type="get" to="robbiehanson.com"><query 
xmlns="jabber:iq:register"><username>johndoe</username></query></iq>
RCV: <iq from='robbiehanson.com' id='JN_1' type='result'><query 
xmlns='jabber:iq:register'><instructions>...</instructions><username/><password/
></query></iq>
jabberClient_OnRegisterInfo
SND: <iq type="set" id="JN_2" to="robbiehanson.com"><query 
xmlns="jabber:iq:register"><instructions>...</instructions><username>johndoe</us
ername><password>...</password></query></iq>
RCV: <iq from='robbiehanson.com' id='JN_2' type='result'><query 
xmlns='jabber:iq:register'><instructions>..</instructions><username>johndoe</use
rname><password>...</password></query></iq>
jabberClient_OnRegistered

I should note, that all of these examples had AutoLogin set to false.
Also, I had an event setup for OnLoginRequired, which was never called.  I 
tested it multiple times to be sure.

Let me know if there's anything else I can answer for you.

Original comment by [email protected] on 1 Apr 2008 at 1:21

from jabber-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
Fixed.  Just call Login() when you're done with registration.

Original comment by [email protected] on 17 Apr 2008 at 7:54

  • Changed state: Fixed

from jabber-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.