Reset password using AppsExtendedEntry

95 views
Skip to first unread message

bcpsoft

unread,
Mar 8, 2011, 6:11:06 PM3/8/11
to Google Apps Domain Information and Management APIs
Hello,

I used to reset password using the following code:

[...]
UserEntry entry;
entry = service.RetrieveUser(userName);
entry.Login.Password = hash;
[...]

Now I'm switching to the multidomain apis:
service = new MultiDomainManagementService(_Domain, applicationName);
service.setUserCredentials(_AdministratorEmail,
_AdministratorPassword);
[...]
AppsExtendedEntry entry;
string email = userName;
string[] table = email.Split('@');
string login= table[0];
string domain = table[1];
entry = service.RetrieveDomainUser(domain,login);

Here, I'm stucked because the "AppsExtendedEntry" doesn't have the
object "Login" in which I can set the new password.

Could you explain me how to reset a user password using the
MultiDomainManagement API?
Indeed, I'm willing to authenticate only to the root domain and be
able to reset passwords in subdomains with this credential.

Thanks in advance.

Prashant Tiwari

unread,
Mar 9, 2011, 1:43:51 AM3/9/11
to google-app...@googlegroups.com
Hi,

The way you update account details using the MDMService has changed slightly. You can update passwords and other fields using the UpdateDomainUser method, which takes the attributes to be updated in a collection of MultiDomainManagementService.MultiDomainUserProperty's. In particular, to update the password, you could do something like:

IDictionary<MultiDomainManagementService.MultiDomainUserProperty, string> updates =
                    new Dictionary<MultiDomainManagementService.MultiDomainUserProperty, string>();
updates[MultiDomainManagementService.MultiDomainUserProperty.Password] = newPassword;
entry = service.UpdateDomainUser(primaryDomain, testUserEmail, updates);

Please take a look at the following classes from our .NET library for more details:


-Prashant

Emmanuel Dreux

unread,
Mar 9, 2011, 3:42:46 AM3/9/11
to google-app...@googlegroups.com, Prashant Tiwari
Hi Prashant,
 
thank you very much for your answer. I'll try this the next time I'll visit my customer.
 
Apparently another thing has changed. In the previous API (using UserEntry), the "password" was actually a MD5 or SHA-1 hash of the password.
Using UpdateDomainUser, it seams that the password field is now the password in clear text.
 
Regards,
Emmanuel.

2011/3/9 Prashant Tiwari <p...@google.com>
--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Prashant Tiwari

unread,
Mar 9, 2011, 4:05:28 AM3/9/11
to google-app...@googlegroups.com
That's right, the password here will be plaintext, no hashing function is required.

-Prashant

Emmanuel Dreux

unread,
Mar 16, 2011, 5:03:44 AM3/16/11
to google-app...@googlegroups.com, Prashant Tiwari
Hello,


Am I impacted since I'm using the Multi Domain API that is sending plaintext? (I think so).

Regards.

2011/3/9 Prashant Tiwari <p...@google.com>
That's right, the password here will be plaintext, no hashing function is required.

-Prashant

--

Prashant Tiwari

unread,
Mar 16, 2011, 5:55:04 AM3/16/11
to google-app...@googlegroups.com
Yes Emmanuel, all new accounts not using hashed passwords will be affected by this change, including the Multi-Domain ones. The existing ones can retain their shorter older password until it's time for them to change, upon which they too will be enforced to set passwords of a minimum of 8 chars.

Prashant Tiwari | Google Developer Relations

Rajan Merwade

unread,
May 3, 2012, 1:08:38 AM5/3/12
to google-app...@googlegroups.com
Hi Prashant 

i have one query one of are customer wanted to implement password policy on his domain.

after 30 days force user to change password.

Please help me out with script. 


On Wednesday, 16 March 2011 15:25:04 UTC+5:30, Prashant Tiwari wrote:
Yes Emmanuel, all new accounts not using hashed passwords will be affected by this change, including the Multi-Domain ones. The existing ones can retain their shorter older password until it's time for them to change, upon which they too will be enforced to set passwords of a minimum of 8 chars.

Prashant Tiwari | Google Developer Relations



On Wed, Mar 16, 2011 at 2:33 PM, Emmanuel Dreux <edr...@gmail.com> wrote:
Hello,


Am I impacted since I'm using the Multi Domain API that is sending plaintext? (I think so).

Regards.

2011/3/9 Prashant Tiwari <p...@google.com>
That's right, the password here will be plaintext, no hashing function is required.

-Prashant

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To post to this group, send email to google-apps-mgmt-apis@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt-apis+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages