Hi,<div><br></div><div>Indeed, this is a bug. I've opened a ticket [1] to keep track of the solution.</div><div><br></div><div>Regards,</div><div><br></div><div>-Tino</div><div><br></div><div>[1] <a href="http://dev.opennebula.org/issues/689">http://dev.opennebula.org/issues/689</a></div>

<div><br clear="all">--<br>Constantino Vázquez Blanco, MSc  <br>OpenNebula Major Contributor<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | @tinova79<br>
<br><br><div class="gmail_quote">On Mon, Jun 20, 2011 at 12:45 PM, Carlos A. <span dir="ltr"><<a href="mailto:caralla@upv.es">caralla@upv.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<u></u>

  
    
  
  <div bgcolor="#ffffff" text="#000000">
    The problem is that in the original one_auth_mad.rb, the code is
    fine (is distinct than the one distributed in the ldap
    authentication addon).<br>
    <br>
    When I install the ldap addon, the resulting one_auth_mad.rb is the
    one that I was dealing with.<br>
    <br>
    (from the ONE bundle directory just uncompressed)<br>
    $ diff ./src/authm_mad/one_auth_mad.rb
    ../one/tmp/ldap-2.2.0/src/one_auth_mad.rb<br>
    (... license ...)<br>
    34a37<br>
    > require 'ldap_auth'<br>
    59c62<br>
    <             @authenticate=driver.new<br>
    ---<br>
    >             @authenticate=driver.new(@config)<br>
    65c68<br>
    <             @authenticate=SimpleAuth.new<br>
    ---<br>
    >             @authenticate=SimpleAuth.new(@config)<br>
    79c82<br>
    <                 request_id, 'Successfully authenticated')<br>
    ---<br>
    >                 request_id, user, token)<br>
    87,92c90<br>
    <         begin<br>
    <             <a href="mailto:auth=@permissions.auth" target="_blank">auth=@permissions.auth</a>(user_id, tokens.flatten)<br>
    <         rescue Exception => e<br>
    <             auth="Error: #{e}"<br>
    <         end<br>
    <         <br>
    ---<br>
    >         <a href="mailto:auth=@permissions.auth" target="_blank">auth=@permissions.auth</a>(user_id, tokens.flatten)<br>
    103,108d100<br>
    < begin<br>
    <     am=AuthorizationManager.new<br>
    < rescue Exception => e<br>
    <     puts "Error: #{e}"<br>
    <     exit(-1)<br>
    < end<br>
    109a102<br>
    > am=AuthorizationManager.new<br>
    <br>
    -----------------------------<br>
    <br>
    You can notice that the line<br>
    <br>
    request_id, 'Successfully authenticated')<br>
    <br>
    has been substituted by the faulty line in the ldap addon<br>
    <br>
    request_id, user, token)<br>
    <br>
    Regards,<br>
    Carlos A.<br>
    <br>
    <br>
    El 20/06/11 12:14, Tino Vazquez escribió:
    <div><div></div><div class="h5"><blockquote type="cite">Hi Carlos,
      <div><br>
      </div>
      <div>I am not able to find the code you are referring to, which
        version of OpenNebula are you using?</div>
      <div><br>
      </div>
      <div>Regards,</div>
      <div><br>
      </div>
      <div>-Tino</div>
      <div><br clear="all">
        --<br>
        Constantino Vázquez Blanco, MSc  <br>
        OpenNebula Major Contributor<br>
        <a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | @tinova79<br>
        <br>
        <br>
        <div class="gmail_quote">On Thu, Jun 16, 2011 at 5:15 PM, Carlos
          A. <span dir="ltr"><<a href="mailto:caralla@upv.es" target="_blank">caralla@upv.es</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
            <div bgcolor="#ffffff" text="#000000"> Hello,<br>
              <br>
              I have finally got it:<br>
              <br>
              I have found 1 error in lib/mads/one_auth_mad.rb<br>
              <br>
              ...<br>
                  def action_authenticate(request_id, user_id, user,
              password, token)<br>
                      <a href="mailto:auth=@authenticate.auth" target="_blank">auth=@authenticate.auth</a>(user_id,
              user, password, token)<br>
                      if auth==true<br>
                          send_message('AUTHENTICATE', RESULT[:success],
              request_id, user, token)<br>
                      else<br>
                          send_message('AUTHENTICATE', RESULT[:failure],<br>
                              request_id, auth)<br>
                      end<br>
                  end<br>
              ...<br>
              <br>
              the problem is the line <br>
                          send_message('AUTHENTICATE', RESULT[:success],
              request_id, user, token)<br>
              <br>
              where there are 5 parameters while send_message needs only
              4. If I leave these 5 parameters, one fails and the one
              daemon dies, but when I remove the last one (token), it
              works both for simple and ldap authentication.<br>
              <br>
              Neither simple or ldap were working before because of the
              exception of the "send_message" function.<br>
              <br>
              The code that I am using (it works for me) is:<br>
              <br>
              ...<br>
                  def action_authenticate(request_id, user_id, user,
              password, token)<br>
                      <a href="mailto:auth=@authenticate.auth" target="_blank">auth=@authenticate.auth</a>(user_id,
              user, password, token)<br>
                      if auth==true<br>
                          send_message('AUTHENTICATE', RESULT[:success],
              request_id, user)<br>
                      else<br>
                          send_message('AUTHENTICATE', RESULT[:failure],
              request_id, auth)<br>
                      end<br>
                  end<br>
              ...<br>
              <br>
              Regards,<br>
              Carlos A.<br>
              <br>
              <br>
              <br>
              El 16/06/11 13:11, Tino Vazquez escribió:
              <blockquote type="cite">Hi Carlos,
                <div><br>
                </div>
                <div>
                  <div>Let's try the driver by hand again, but also with
                    the authentication part:</div>
                  <div><br>
                  </div>
                  <div> <span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">#
                      ruby -dw $ONE_LOCATION/lib/mads/one_</span><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">auth_mad.rb</span></div>
                  <div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">
                      AUTHENTICATE 0 -1 <LDAP_DN> -
                      <LDAP_DN:plain:LDAP_PASSWORD></span></div>
                  <div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><br>
                    </span></div>
                  <div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">this

                      will tell if the failure is in the driver or the
                      core.</span></div>
                  <div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><br>
                    </span></div>
                  <div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">Regards,</span></div>
                  <div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><br>
                    </span></div>
                  <div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">-Tino</span></div>
                  <div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br clear="all">
                      </span></font>--<br>
                    Constantino Vázquez Blanco, MSc  <br>
                    OpenNebula Major Contributor<br>
                    <a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a>
                    | @tinova79<br>
                  </div>
                </div>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br></div>