Custom Authentication error message

0 views
Skip to first unread message

sylver

unread,
Dec 12, 2008, 11:18:57 AM12/12/08
to SamePlace/xmpp4moz
Hi,

I'm wondering whether we can customize our own "login error message",
rather than relying XMPP4MOZ's alert that displays "XMPP: Error during
authentication"?

Sameplace uses the "connector" object to verify account when we setup
an account using the wizard. Might that be the way?

Thanks :D

Brett Zamir

unread,
Dec 12, 2008, 2:23:25 PM12/12/08
to same...@googlegroups.com
At present, it is not possible to replace the "XMPP: Error during
authentication" message (from xmpp4moz).

I submitted a patch a few days ago which would let you do this, however
(and would also give you the specific SASL error type (
http://xmpp.org/rfcs/rfc3920.html#rfc.section.6.4 ) and optionally a
predefined message for it based on the explanation in the spec.

So, in my modified version (assuming Massimiliano likes to keep the way
I implemented it), you'd be able to do something like this:

channel.on (
{
event : 'connector',
state : 'sasl-error'
},
function (el) {
var condition = XMPP.getSASLFailureCondition(el.info);
if (condition === 'temporary-auth-failure') { //
Handle a specific type of SASL error message in a special way
alert('Temporary authorization failure for
'+el.account+'; try again later.');
}
else { // Use the default message
alert(XMPP.getSASLFailureMessage(condition));
}
XMPP.close(el.account);
}
);

Brett

sylver

unread,
Dec 14, 2008, 3:17:50 AM12/14/08
to SamePlace/xmpp4moz
Thanks for your fast reply :D

this update is not in version 2008121119 yet? Can't seem to make your
sample code to work.

cheers.

>
> At present, it is not possible to replace the "XMPP: Error during
> authentication" message (from xmpp4moz).
>
> I submitted a patch a few days ago which would let you do this, however
> (and would also give you the specific SASL error type (http://xmpp.org/rfcs/rfc3920.html#rfc.section.6.4) and optionally a

Brett Zamir

unread,
Dec 14, 2008, 3:57:59 AM12/14/08
to same...@googlegroups.com
It's not in any version yet besides my own local copy... It's just a patch--i.e., Massimiliano will need to look at it to decide whether he will accept it as is, change it, etc.

best,
Brett

sylver

unread,
Dec 15, 2008, 3:02:32 AM12/15/08
to SamePlace/xmpp4moz
Alright. will wait for the approval then.

Thanks for your hard work :D
Reply all
Reply to author
Forward
0 new messages