class Glima::IMAP::Xoauth2Authenticator

Public Class Methods

new(user, oauth2_token) click to toggle source
# File lib/glima/imap.rb, line 54
def initialize(user, oauth2_token)
  @user = user
  @oauth2_token = oauth2_token
end

Public Instance Methods

process(data) click to toggle source
# File lib/glima/imap.rb, line 59
def process(data)
  build_oauth2_string(@user, @oauth2_token)
end

Private Instance Methods

build_oauth2_string(user, oauth2_token) click to toggle source

developers.google.com/google-apps/gmail/xoauth2_protocol

# File lib/glima/imap.rb, line 65
def build_oauth2_string(user, oauth2_token)
  str = "user=%s\1auth=Bearer %s\1\1".encode("us-ascii") % [user, oauth2_token]
  return str
end