Class: Rack::Auth::Ldap::Request

Inherits:
Auth::AbstractRequest
  • Object
show all
Defined in:
lib/rack/auth/ldap.rb

Overview

Note:

please do not instantiate manually, used by Rack::Auth:Ldap

Request class the LDAP credentials authenticator

Instance Method Summary collapse

Instance Method Details

#basic?FalseClass, TrueClass

return true if the auth scheme provide is really a basic scheme

Returns:

  • (FalseClass, TrueClass)

    the result



176
177
178
# File 'lib/rack/auth/ldap.rb', line 176

def basic?
  !parts.first.nil? && "basic" == scheme
end

#credentialsArray

return an array of the two credentials [username,password]

Returns:

  • (Array)

    the couple [username,password]



182
183
184
# File 'lib/rack/auth/ldap.rb', line 182

def credentials
  @credentials ||= params.unpack("m*").first.split(/:/, 2)
end

#passwordString

read accessor on the last credentials, password

Returns:

  • (String)

    the password



194
195
196
# File 'lib/rack/auth/ldap.rb', line 194

def password
  credentials.last
end

#usernameString

read accessor on the first credentials, username

Returns:

  • (String)

    the username



188
189
190
# File 'lib/rack/auth/ldap.rb', line 188

def username
  credentials.first
end