Class: OmniAuth::Strategies::Box

Inherits:
Object
  • Object
show all
Includes:
OmniAuth::Strategy
Defined in:
lib/omniauth-box.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auth_tokenObject

Returns the value of attribute auth_token.



15
16
17
# File 'lib/omniauth-box.rb', line 15

def auth_token
  @auth_token
end

Instance Method Details

#accountObject



17
18
19
# File 'lib/omniauth-box.rb', line 17

def 
  ::Box::Account.new(options[:api_token])
end

#callback_phaseObject



33
34
35
36
# File 'lib/omniauth-box.rb', line 33

def callback_phase
  self.auth_token = request.params["auth_token"]
  super
end

#clientObject



21
22
23
24
25
# File 'lib/omniauth-box.rb', line 21

def client
  client = ::Box::Api.new(options[:api_token])
  client.set_auth_token(self.auth_token)
  client
end

#raw_infoObject



50
51
52
# File 'lib/omniauth-box.rb', line 50

def raw_info
  @raw_info ||= client.
end

#request_phaseObject



27
28
29
30
31
# File 'lib/omniauth-box.rb', line 27

def request_phase
  .authorize do |authorize_url|
    return redirect authorize_url
  end
end