Module: Backends::Opennebula::Authn::CloudAuth::X509CloudAuth

Defined in:
lib/backends/opennebula/authn/cloud_auth/x509_cloud_auth.rb

Instance Method Summary collapse

Instance Method Details

#do_auth(params = {}) ⇒ Object


19
20
21
22
23
24
25
26
27
# File 'lib/backends/opennebula/authn/cloud_auth/x509_cloud_auth.rb', line 19

def do_auth(params = {})
  fail Backends::Errors::AuthenticationError, 'Credentials for X.509 not set!' unless params && params[:client_cert_dn]

  # Password should be DN with whitespaces removed.
  username = get_username(X509Auth.escape_dn(params[:client_cert_dn]))
  return nil if username.blank?

  username
end