Class: BasicAndNego::Auth::GSS

Inherits:
Object
  • Object
show all
Defined in:
lib/basic_and_nego/auth/gss.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger, service, realm, keytab) ⇒ GSS

Can raise GSSAPI::GssApiError



11
12
13
14
15
16
17
18
19
# File 'lib/basic_and_nego/auth/gss.rb', line 11

def initialize(logger, service, realm, keytab)
  @logger = logger
  @service = service
  @realm = realm
  @keytab = keytab
  @gssapi = GSSAPI::Simple.new(@realm, @service, @keytab)

  gssapi.acquire_credentials
end

Instance Attribute Details

#gssapiObject (readonly)

Returns the value of attribute gssapi.



6
7
8
# File 'lib/basic_and_nego/auth/gss.rb', line 6

def gssapi
  @gssapi
end

#loggerObject (readonly)

Returns the value of attribute logger.



6
7
8
# File 'lib/basic_and_nego/auth/gss.rb', line 6

def logger
  @logger
end

Instance Method Details

#authenticate(token) ⇒ Object

Attempt to authenticate the furnished token against gssapi

It return nil (in case of error) or the token sent back by the gssapi if the authentication is successfull



27
28
29
# File 'lib/basic_and_nego/auth/gss.rb', line 27

def authenticate(token)
  return gssapi.accept_context(token)
end

#display_nameObject



31
32
33
# File 'lib/basic_and_nego/auth/gss.rb', line 31

def display_name
  return gssapi.display_name
end