class HammerCLIForeman::Api::NegotiateAuth
Public Class Methods
new(foreman_url, **options)
click to toggle source
Calls superclass method
# File lib/hammer_cli_foreman/api/negotiate_auth.rb, line 4 def initialize(foreman_url, **options) super("#{foreman_url}/api/users/extlogin", HammerCLI::SSLOptions.new.get_options(foreman_url).merge(options)) end
Public Instance Methods
error(ex)
click to toggle source
Calls superclass method
# File lib/hammer_cli_foreman/api/negotiate_auth.rb, line 24 def error(ex) super unless ex.is_a?(RestClient::Unauthorized) message = _('Invalid username or password.') begin message = JSON.parse(ex.response.body)['error']['message'] rescue end UnauthorizedError.new(message) end
session_id()
click to toggle source
# File lib/hammer_cli_foreman/api/negotiate_auth.rb, line 12 def session_id auth_cookie&.delete_prefix('_session_id=') end
status()
click to toggle source
# File lib/hammer_cli_foreman/api/negotiate_auth.rb, line 16 def status if system('klist') _('No session, but there is an active Kerberos session, that will be used for negotiate login.') else _('There is no active Kerberos session. Have you run %s?') % 'kinit' end end
user()
click to toggle source
# File lib/hammer_cli_foreman/api/negotiate_auth.rb, line 8 def user _('current Kerberos user') end