123456789_123456789_123456789_123456789_123456789_

Class: Net::SMTP::AuthXoauth2

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Net::SMTP::Authenticator
Defined in: lib/net/smtp/auth_xoauth2.rb

Class Method Summary

Instance Attribute Summary

Authenticator - Inherited

Instance Method Summary

Constructor Details

This class inherits a constructor from Net::SMTP::Authenticator

Instance Method Details

#auth(user, secret)

[ GitHub ]

  
# File 'lib/net/smtp/auth_xoauth2.rb', line 5

def auth(user, secret)
  token = xoauth2_string(user, secret)

  finish("AUTH XOAUTH2 #{base64_encode(token)}")
end

#xoauth2_string(user, secret) (private)

[ GitHub ]

  
# File 'lib/net/smtp/auth_xoauth2.rb', line 13

def xoauth2_string(user, secret)
  "user=#{user}\1auth=Bearer #{secret}\1\1"
end