Module: Jabber::SASL

Defined in:
lib/xmpp4r/sasl.rb

Overview

Helpers for SASL authentication (RFC2222)

You might not need to use them directly, they are invoked by Jabber::Client#auth

Defined Under Namespace

Classes: Anonymous, Base, DigestMD5, Plain

Constant Summary collapse

NS_SASL =
'urn:ietf:params:xml:ns:xmpp-sasl'

Class Method Summary collapse

Class Method Details

.new(stream, mechanism) ⇒ Object

Factory function to obtain a SASL helper for the specified mechanism



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/xmpp4r/sasl.rb', line 19

def SASL.new(stream, mechanism)
  case mechanism
    when 'DIGEST-MD5'
      DigestMD5.new(stream)
    when 'PLAIN'
      Plain.new(stream)
    when 'ANONYMOUS'
      Anonymous.new(stream)
    else
      raise "Unknown SASL mechanism: #{mechanism}"
  end
end