Class: AuthProxy::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/auth_proxy/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



8
9
10
# File 'lib/auth_proxy/config.rb', line 8

def initialize
  self.providers = {}
end

Instance Attribute Details

#app_domainObject

Returns the value of attribute app_domain.



2
3
4
# File 'lib/auth_proxy/config.rb', line 2

def app_domain
  @app_domain
end

Returns the value of attribute cookie_domain.



3
4
5
# File 'lib/auth_proxy/config.rb', line 3

def cookie_domain
  @cookie_domain
end

#providersObject

Returns the value of attribute providers.



4
5
6
# File 'lib/auth_proxy/config.rb', line 4

def providers
  @providers
end

#sslObject

Returns the value of attribute ssl.



5
6
7
# File 'lib/auth_proxy/config.rb', line 5

def ssl
  @ssl
end

#views_pathObject

Returns the value of attribute views_path.



6
7
8
# File 'lib/auth_proxy/config.rb', line 6

def views_path
  @views_path
end

Instance Method Details

#register(provider, display_name:, app_id:, app_secret:, options: {}, validator: nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/auth_proxy/config.rb', line 12

def register(provider, display_name:, app_id:, app_secret:, options: {}, validator: nil)
  options[:callback_path] ||= "/auth/#{provider}/callback"
  providers[provider.to_s] = {
    provider: provider,
    display_name: display_name,
    app_id: app_id,
    app_secret: app_secret,
    validator: validator,
    options: options
  }
end