2013-08-23 01:21:52 -05:00
|
|
|
class Plugin::AuthProvider
|
2015-09-25 10:29:05 -05:00
|
|
|
|
|
|
|
def self.auth_attributes
|
|
|
|
[:glyph, :background_color, :title, :message, :frame_width, :frame_height, :authenticator,
|
2016-04-20 12:19:38 -05:00
|
|
|
:title_setting, :enabled_setting, :full_screen_login, :custom_url]
|
2015-09-25 10:29:05 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
attr_accessor(*auth_attributes)
|
2013-08-25 20:04:16 -05:00
|
|
|
|
2013-08-25 21:52:36 -05:00
|
|
|
def name
|
|
|
|
authenticator.name
|
|
|
|
end
|
|
|
|
|
2015-09-25 10:29:05 -05:00
|
|
|
def to_json
|
2017-07-27 20:20:09 -05:00
|
|
|
result = { name: name }
|
2016-04-20 12:19:38 -05:00
|
|
|
result['customUrl'] = custom_url if custom_url
|
2015-09-25 10:29:05 -05: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 21:11:39 -05:00
|
|
|
result['fullScreenLogin'] = full_screen_login if full_screen_login
|
2015-09-25 10:29:05 -05:00
|
|
|
result.to_json
|
|
|
|
end
|
|
|
|
|
2013-08-23 01:21:52 -05:00
|
|
|
end
|