Hi Chris,

There's a sample application in the library showing how to create users in
a multi-domain environment:

http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/gapps_multidomain_sample/multidomaindemo.cs?r=1079

Also, check this thread for some C# code to compute the SHA-1 hash:

https://groups.google.com/forum/embed/?place=msg%2Fgoogle-apps-mgmt-apis%2FLrnOrZalrHc%2FFpbXDa6dY9QJ

Claudio

On Wed, May 2, 2012 at 1:04 PM, Chris Heath <[email protected]> wrote:

> I am trying to create an account using a hashed password instead of a
> plaintext password.  I am pulling the sha-1 hash value out of a RH
> Enterprise Directory Server.  Problem is that I can't get the syntax quite
> right.  I have tried every variation I can think of.  Here is some test
> code I tried and all 48 cases failed.  Anybody have any ideas?
>     {
>         MultiDomainManagementService mdms = GoogleHelper.GetMDMS("
> example.edu");
>         AppsExtendedEntry eUser;
>         string sDomain = "southalabama.edu", sMail = "[email protected]
> ";
>         string[] asPasswords = new string[] {
> "2bX8XF9kC0kDIMdlYBDxhZmu624E29SDmTY7CA",
> "{SSHA}2bX8XF9kC0kDIMdlYBDxhZmu624E29SDmTY7CA==",
> "2bX8XF9kC0kDIMdlYBDxhZmu624E29SDmTY7CA==",
> "{SSHA}2bX8XF9kC0kDIMdlYBDxhZmu624E29SDmTY7CA" };
>         string[] asHashFuncs = new string[] { "SHA-1", "SHA1", "SSHA",
> "sha-1", "sha1", "ssha", "{SHA-1}", "{SHA1}", "{SSHA}", "{sha-1}",
> "{sha1}", "{ssha}" };
>         int iFails = 0;
>         bool bDoBreak = false;
>         foreach (string sPassword in asPasswords)
>         {
>             foreach (string sHashFunc in asHashFuncs)
>             {
>                 try
>                 {
>                     eUser = mdms.CreateDomainUser(sDomain, sMail,
>                         sPassword, sHashFunc,
>                         "firstName", "LastName", false);
>
>                     //eUser = mdms.CreateDomainUser(sDomain, sMail,
>                     //    sPassword,
>                     //    "firstName","LastName",false);
>                     Master.NoteText("this worked: sPassword=|" + sPassword
> + "|, HashFunc=|" + sHashFunc + "|");
>                     bDoBreak = true;
>                     break;
>                 }
>                 catch
>                 {
>                     iFails++;
>                 }
>             }
>             if (bDoBreak)
>                 break;
>         }
>         Master.NoteText("fails=" + iFails.ToString());
>     }
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Apps Domain Information and Management APIs" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-apps-mgmt-apis/-/dAKrSME9eRIJ.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-apps-mgmt-apis?hl=en.
>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Reply via email to