Skip to content

Commit

Permalink
B #5049: Unable to web login when quotes in passwd (#174)
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Diaz <rdiaz@opennebula.io>
(cherry picked from commit 2d31aca)
  • Loading branch information
Ricardo Diaz authored and rsmontero committed Oct 6, 2020
1 parent 7b3dd89 commit 0b3ac16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cloud/common/CloudAuth/OpenNebulaCloudAuth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def do_auth(env, params={})

# Check if the user authenticated with a scoped token. In this case
# encode the EGID in the username as "user:egid"
egid = user["//LOGIN_TOKEN [ TOKEN = \"#{password}\" ]/EGID"]
egid = nil
egid = user["//LOGIN_TOKEN [ TOKEN = \"#{password}\" ]/EGID"] if password.match(/^[a-z0-9]+$/)

auth_name = user.name
auth_name = "#{auth_name}:#{egid}" if egid
Expand Down

0 comments on commit 0b3ac16

Please sign in to comment.