mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2008
Posts: 5
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Sep 2008
Posts: 5
First of all, credits: This is not my work, I only adapted it for my purposes. The original work comes from http://pastebin.com/VbG6wSrN. Having said that ... At some point I started getting the SASL authentication required message from Freenode. Freenode's solution is somewhat odd, you are supposed to get a script and a DLL, but those are not working for me.

I came across the pastebin script which seemed like an easier approach. If you look at the script, you will see %user and %password. As far as I can tell, those variables actually never get defined. Because of that, the script failed. What I added are two sections defining those variables in order to get the script to complete the connection.

Code:
on ^*:LOGON:*:{
  if ($network == Freenode) { 
    var %user = ENTER YOUR USERNAME HERE
    var %password = ENTER YOUR PASSWORD HERE
  }
  .raw CAP LS
  echo -s Checking capabilities...
  .raw USER %user 0 * : $+ $fullname
  .raw NICK $mnick
  enable #sasl
  halt
}

#sasl off

raw 001:*:disable #sasl

raw CAP:* LS *:{
  echo -s Capabilities: $3-
  var %tok

  if ($findtok($3-,sasl,32) != $null) {
    set %tok $addtok(%tok,sasl,32)
  }

  if ($findtok($3-,multi-prefix,32) != $null) {
    set %tok $addtok(%tok,multi-prefix,32)
  }

  if ($findtok($3-,packet-size,32) != $null) {
    set %tok %addtok(%tok,packet-size=1024,32)
  }

  if (%tok != $null) {
    echo -s Enabling: %tok
    .raw CAP REQ : $+ %tok
  }

  if ($findtok($3-,sasl,32) == $null) {
    .raw CAP END
  }
  halt
}

raw CAP:* ACK sasl*:{
  .raw AUTHENTICATE PLAIN
}

raw AUTHENTICATE:+:{
  if ($network == Freenode) { 
    var %user = ENTER YOUR USERNAME HERE
    var %password = ENTER YOUR PASSWORD HERE
  }
  sasl-plain %user %password
  halt
}

raw 903:*:.raw CAP END
raw 904:*:.raw CAP END
raw 905:*:.raw CAP END
raw 906:*:.raw CAP END
raw 907:*:.raw CAP END

#sasl end

alias sasl-plain {
  bset -t &auth 1 $1
  bset -t &auth $calc( $bvar(&auth,0) + 2 ) $1
  bset -t &auth $calc( $bvar(&auth,0) + 2 ) $2
  var %len = $encode(&auth,mb)
  .raw AUTHENTICATE $bvar(&auth,1,%len).text
}


The code that I added in two spots in the script should support multiple servers:

Code:
  if ($network == Freenode) { 
    var %user = ENTER YOUR USERNAME HERE
    var %password = ENTER YOUR PASSWORD HERE
  }


If another network started using SASL authentication, I would simply add two more blocks below the existing "if ($network ==" blocks, e.g.

Code:
  if ($network == Freenode) { 
    var %user = ENTER YOUR USERNAME HERE
    var %password = ENTER YOUR PASSWORD HERE
  }
if ($network == NEW NETWORK) { 
    var %user = ENTER YOUR OTHER USERNAME HERE
    var %password = ENTER YOUR OTHER PASSWORD HERE
  }


I am sure the script could be simplified, streamlined etc. So anyway, here it is, a working SASL authentication script for Freenode with mIRC 7.15. All you need to do is enter your username and your password in two locations. And yes, very inefficient of me. wink

Joined: Jan 2012
Posts: 2
E
Bowl of petunias
Offline
Bowl of petunias
E
Joined: Jan 2012
Posts: 2
when using this script, I get the following:

Capabilities: account-notify extended-join identify-msg multi-prefix sasl
Enabling: sasl multi-prefix
USER Not enough parameters
-
* /bset: insufficient parameters (line 67, script1.mrc)
-
irc.freenode.net AUTHENTICATE +

ideas? And I have not registered an account so how can I login if I do not have an account?

Joined: Mar 2019
Posts: 1
S
spc Offline
Mostly harmless
Offline
Mostly harmless
S
Joined: Mar 2019
Posts: 1
Originally Posted By: elRey
when using this script, I get the following:

Capabilities: account-notify extended-join identify-msg multi-prefix sasl
Enabling: sasl multi-prefix
USER Not enough parameters
-
* /bset: insufficient parameters (line 67, script1.mrc)
-
irc.freenode.net AUTHENTICATE +

ideas? And I have not registered an account so how can I login if I do not have an account?


i think there's no reply from the poster. so far, the only way is updating the mirc version to solve it.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
You necro'd a dead thread from 2010 and 2012. Native SASL support was added to mIRC in 2017.

No need to reply. Let it die.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard