2013-08-23 02:21:52 -04:00
|
|
|
class Plugin::AuthProvider
|
2015-09-25 11:29:05 -04:00
|
|
|
|
|
|
|
def self.auth_attributes
|
|
|
|
[:glyph, :background_color, :title, :message, :frame_width, :frame_height, :authenticator,
|
2016-04-20 13:19:38 -04:00
|
|
|
:title_setting, :enabled_setting, :full_screen_login, :custom_url]
|
2015-09-25 11:29:05 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
attr_accessor(*auth_attributes)
|
2013-08-25 21:04:16 -04:00
|
|
|
|
2013-08-25 22:52:36 -04:00
|
|
|
def name
|
|
|
|
authenticator.name
|
|
|
|
end
|
|
|
|
|
2015-09-25 11:29:05 -04:00
|
|
|
def to_json
|
|
|
|
result = {name: name}
|
2016-04-20 13:19:38 -04:00
|
|
|
result['customUrl'] = custom_url if custom_url
|
2015-09-25 11:29:05 -04:00
|
|
|
result['titleOverride'] = title if title
|
|
|
|
result['titleSetting'] = title_setting if title_setting
|
|
|
|
result['enabledSetting'] = enabled_setting if enabled_setting
|
|
|
|
result['messageOverride'] = message if message
|
|
|
|
result['frameWidth'] = frame_width if frame_width
|
|
|
|
result['frameHeight'] = frame_height if frame_height
|
2015-10-12 22:11:39 -04:00
|
|
|
result['fullScreenLogin'] = full_screen_login if full_screen_login
|
2015-09-25 11:29:05 -04:00
|
|
|
result.to_json
|
|
|
|
end
|
|
|
|
|
2013-08-23 02:21:52 -04:00
|
|
|
end
|