[one-users] URGENT: hi, please respond fast

Piyush Harsh piyush.harsh at inria.fr
Tue Jan 17 13:40:26 PST 2012


Hi Ales,

That is what I suspected and was what I was going to try next but thought of post on the mailing list for quick answer :) Thanks for your reply.

Regards,
Piyush.

----- Original Message -----
> From: "Ales Cernivec" <ales.cernivec at xlab.si>
> To: "Piyush Harsh" <piyush.harsh at inria.fr>
> Cc: "Daniel Molina" <dmolina at opennebula.org>, "Opennebula User Forum" <users at lists.opennebula.org>
> Sent: Tuesday, January 17, 2012 5:05:13 PM
> Subject: Re: URGENT: hi, please respond fast
> Hi Pyush,
> 
> Maybe the problem is with
> 
> OneResponse val = User.allocate(oneClient, name, password);
> 
> where you are using plain text for password parameter. Simple Java
> application for makeSHA1Hash:
> 
> ----
> import java.security.MessageDigest;
> import java.security.NoSuchAlgorithmException;
> 
> class SHATest{
> 
> public static String makeSHA1Hash(String input)
> throws NoSuchAlgorithmException
> {
> MessageDigest md = MessageDigest.getInstance("SHA1");
> md.reset();
> byte[] buffer = input.getBytes();
> md.update(buffer);
> byte[] digest = md.digest();
> 
> String hexStr = "";
> for (int i = 0; i < digest.length; i++) {
> hexStr += Integer.toString( ( digest[i] & 0xff ) + 0x100,
> 16).substring( 1 );
> }
> return hexStr;
> }
> 
> public static void main(String[] args) throws
> NoSuchAlgorithmException{
> System.out.println(makeSHA1Hash("o3fcIsO9sCVx5JFkAMYCheMjjnbugttZ"));
> 
> }
> }
> ----
> 
> It returns "a5e8ec175d8f51d330c43da4959b6c3b3979f871". This one should
> be used for password parameter for your "Mw3rlbQo" user.
> 
> Maybe this helps.
> 
> Regards,
> Ales.
> 
> On Tue, 2012-01-17 at 16:30 +0100, Piyush Harsh wrote:
> > Hi Daniel,
> >
> > I need some help with ONE Java APIs for version 2.2. I created a
> > user using
> >
> > OneResponse val = User.allocate(oneClient, name, password);
> >
> > where name is the username is the 8 character and password is the 32
> > character alphanumeric string (both) randomly generated by my code.
> >
> > Next I tried to retrieve image pool information using this created
> > user's credentials but the java call fails. The error I am getting
> > is:
> >
> > [ImagePoolInfo] User couldn't be authenticated, aborting call.
> >
> > I use the same username and the password that I generated to create
> > the
> > ONE user while creating the ONE Client class object.
> >
> > Here is the oneuser list output:
> >
> >    ID USER PASSWORD
> >     0 oneadmin 8944aada99d6d0121494dd0ac8129db653bc1f4a
> >     5 Mw3rlbQo o3fcIsO9sCVx5JFkAMYCheMjjnbugttZ
> >
> > The function call I am using to create the client object is:
> >
> > Client oneClient = new
> > Client("Mw3rlbQo:o3fcIsO9sCVx5JFkAMYCheMjjnbugttZ",
> > "http://127.0.0.1:2633/RPC2");
> >
> > what am I doing wrong?
> >
> > Any help you provide will be most helpful.
> >
> > Kind regards,
> > Piyush.

-- 
Dr. Piyush Harsh, R&D Engineer, INRIA
CONTRAIL Project, INRIA Rennes - Bretagne Atlantique
Campus universitaire de Beaulieu, 35042 Rennes cedex, France
Phone. +33 2 99 84 71 53 - Fax. +33 2 99 84 71 71
http://www.irisa.fr/myriads/
http://www.cise.ufl.edu/~pharsh/portfolio/



More information about the Users mailing list