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

Ales Cernivec ales.cernivec at xlab.si
Tue Jan 17 08:05:13 PST 2012


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.





More information about the Users mailing list