1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #1741: escape dn in X509CloudAuth.rb

This commit is contained in:
Javi Fontan 2013-02-22 16:59:46 +01:00
parent 7b9c6561ea
commit 02cd738d8f

View File

@ -14,6 +14,8 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'opennebula/x509_auth'
module X509CloudAuth
def do_auth(env, params={})
# For https, the web service should be set to include the user cert in the environment.
@ -32,7 +34,8 @@ module X509CloudAuth
end
# Password should be DN with whitespace removed.
username = get_username(cert.subject.to_s.delete("\s"))
username = get_username(
OpenNebula::X509Auth.escape_dn(cert.subject.to_s))
return username if username