Subject: | bug with createUser when passing admin or passwordHashFunction |
Date: | Mon, 05 Oct 2009 11:21:55 -0700 |
To: | bug-REST-Google-Apps-Provisioning [...] rt.cpan.org |
From: | Casey Feskens <cfeskens [...] willamette.edu> |
I stumbled into a bug with createUser when trying to pass
passwordHashFunction. It appears that the google API only allows a
single instance of <apps:login>. Provisioning.pm adds extra instances
if passwordHashFunction or admin args are passed to createUser:
Google returns the following result:
DB<2> print $response->content();
[Line 5, Column 42, element atom:entry] Duplicate extension element
http://schemas.google.com/apps/2006:login
I've attached a patch as one way to resolve the issue.
--- Provisioning.pm.orig 2009-10-05 10:09:07.588870938 -0700
+++ Provisioning.pm.patched 2009-10-05 11:12:15.847870732 -0700
@@ -87,9 +87,10 @@
$body = $self->_xmlpre();
$body .= qq( <atom:category
scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/apps/2006#user" />\n);
- $body .= qq( <apps:login userName="$arg->{'username'}"
password="$arg->{'password'}" suspended="false" />\n);
- $body .= qq( <apps:login
hashFunctionName="$arg->{'passwordHashFunction'}" />\n) if
$arg->{'passwordHashFunction'};
- $body .= qq( <apps:login admin="$arg->{'admin'} />\n) if
$arg->{'admin'};
+ $body .= qq( <apps:login userName="$arg->{'username'}"
password="$arg->{'password'}" suspended="false");
+ $body .= qq( hashFunctionName="$arg->{'passwordHashFunction'}") if
$arg->{'passwordHashFunction'};
+ $body .= qq( admin="$arg->{'admin'}") if $arg->{'admin'};
+ $body .= qq( />\n);
$body .= qq( <apps:quota limit="$arg->{'quotaLimitInMB'}" />\n) if
$arg->{'quotaLimitInMB'};
$body .= qq( <apps:name familyName="$arg->{'familyName'}"
givenName="$arg->{'givenName'}" />\n);
$body .= $self->_xmlpost();
--
---------------------------------------------
Casey Feskens<cfeskens@willamette.edu>
System Administrator/Network Svcs. Consultant
Willamette Integrated Technology Services
Willamette University, Salem, OR
Phone: (503) 370-6950
Fax: (503) 375-5456
---------------------------------------------
Message body is not shown because sender requested not to inline it.