cancel
Showing results for 
Search instead for 
Did you mean: 

User import or setPassword

tpeelen
Champ in-the-making
Champ in-the-making
Hi All,

We want to use the default user+group management in Alfresco (2.1.0). I have 2 questions:
1) Is there an easy way to import users + groups? I can see how to bootstrap, but what if there are no DB id's etc.?? Is there a nice way to get the persons in? For example without a restart of Alfresco?
2) If I have my users/groups in, is there a way to easily change the passwords? They were created using username=password, but that is unacceptable. I can modify the password using SQL, but how is it encrypted? Is there a better/faster/smarter way?

Thanks in advance,

Tjarda Peelen
The Netherlands
2 REPLIES 2

tpeelen
Champ in-the-making
Champ in-the-making
I am able to get all usernames/passwords in the system in bulk, but each user needs a non-trivial password (they are currently assigned a trivial password). The plan is to set the passwords in the database by some Perl script, and to send the owner an automated email with this password. We've realized all but setting the password.

I can generate a list f users with the relevant password

SELECT a.string_value, b.string_value
FROM alf_node_properties as a, alf_node_properties as b
WHERE (a.node_id = b.node_id)
AND (a.qname like '%username')
AND (b.qname like '%password')
but how is the password created (user auth. in Alfresco, Alfresco 2.1.0)? It appears to use MD4, transformed to hex (MD4PasswordEncoderImpl.java)

I try in Perl:


#!/usr/bin/perl -w

use strict;
use Digest::MD4;

my $result;
my $ctx;
my $plaintext_pass;

if (defined($ARGV[0])) {
    $plaintext_pass = $ARGV[0];
} else {
    print "Usage : scriptname plaintextpassword\n";
    exit 1;
}

$ctx = Digest::MD4->new;

$ctx->add($plaintext_pass);

$result = $ctx->hexdigest;

print "MD4 : $result\n";

exit 0;

Anyone a clue?

andy
Champ on-the-rise
Champ on-the-rise
Hi

There is a Java example of how to encode passwords on the wiki.

Andy