class Jabber::Client

****************************************************************************

Public Instance Methods

auth(password) click to toggle source

Authenticate with the server

Throws ClientAuthenticationFailure

Authentication mechanisms are used in the following preference:

password
String

THIS OVERRIDES XMPP4R method of the same


# File lib/kinokero/sasl_xoauth2.rb, line 34
def auth(password)

  begin
    if @stream_mechanisms.include? MECHANISM_XOAUTH2
      auth_sasl SASL.new(self, MECHANISM_XOAUTH2), password
    elsif @stream_mechanisms.include? 'DIGEST-MD5'
      auth_sasl SASL.new(self, 'DIGEST-MD5'), password
    elsif @stream_mechanisms.include? 'PLAIN'
      auth_sasl SASL.new(self, 'PLAIN'), password
    else
      auth_nonsasl(password)
    end

  rescue
    Jabber::debuglog("#{$!.class}: #{$!}\n#{$!.backtrace.join("\n")}")
    raise ClientAuthenticationFailure.new, $!.to_s
  end

end