You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Gary Lawrence Murphy <ga...@canada.com> on 2003/01/06 19:51:11 UTC

Re: encrypted passwords

Ok, I have to admit that I didn't try really hard, I just tried the
same method I used for encrypting openldap passwords and it didn't
work: How do you bootstrap the initial encrypted passwords for a
first-time installation?

Obviously, the jetspeed om scripts need to have pre-encrypted
strings as the passwords, but how should these be generated?

-- 
Gary Lawrence Murphy - garym@teledyn.com - TeleDynamics Communications
   - blog: http://www.teledyn.com/mt/ - biz: http://teledyn.com/ -
  "Computers are useless. They can only give you answers." (Picasso)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: encrypted passwords

Posted by Gary Lawrence Murphy <ga...@canada.com>.
>>>>> "D" == David Sean Taylor <da...@bluesunrise.com> writes:

    D> Run it from a command line utility, or from an action.  I can
    D> send you an action class (that Mark wrote) if you are
    D> interested....

Yes, please do, and thanks for the kind offer.

    D> We haven't checked it in since it can corrupt passwords if ran
    D> twice

No doubt ;)  

-- 
Gary Lawrence Murphy - garym@teledyn.com - TeleDynamics Communications
   - blog: http://www.teledyn.com/mt/ - biz: http://teledyn.com/ -
  "Computers are useless. They can only give you answers." (Picasso)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: encrypted passwords

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Monday, January 6, 2003, at 01:50  PM, Gary Lawrence Murphy wrote:

>>>>>> "D" == David Sean Taylor <da...@bluesunrise.com> writes:
>
>     D> Iterator users = JetspeedSecurity.getUsers(); while
>     D> (users.hasNext()) { ...
>
> Oh, that's clever -- thanks!
>
> I suppose I could place that code into the init function of some pull
> service?  It's only needed when the site is rebuilt from scratch, and
> it's essential it's never run more than once (like when the server is
> rebooted), but it also can't be in a secure portlet because admin
> needs to login before they can run the admin portlets.
>
> Are there any recommended places to put one-shot temp code like this?

Run it from a command line utility, or from an action.
I can send you an action class (that Mark wrote) if you are 
interested....

We haven't checked it in since it can corrupt passwords if ran twice

--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
+01 707 773-4646




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: encrypted passwords

Posted by Gary Lawrence Murphy <ga...@canada.com>.
>>>>> "D" == David Sean Taylor <da...@bluesunrise.com> writes:

    D> Iterator users = JetspeedSecurity.getUsers(); while
    D> (users.hasNext()) { ...

Oh, that's clever -- thanks!

I suppose I could place that code into the init function of some pull
service?  It's only needed when the site is rebuilt from scratch, and
it's essential it's never run more than once (like when the server is
rebooted), but it also can't be in a secure portlet because admin
needs to login before they can run the admin portlets.

Are there any recommended places to put one-shot temp code like this?

-- 
Gary Lawrence Murphy - garym@teledyn.com - TeleDynamics Communications
   - blog: http://www.teledyn.com/mt/ - biz: http://teledyn.com/ -
  "Computers are useless. They can only give you answers." (Picasso)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: encrypted passwords

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Monday, January 6, 2003, at 10:51  AM, Gary Lawrence Murphy wrote:

>
> Ok, I have to admit that I didn't try really hard, I just tried the
> same method I used for encrypting openldap passwords and it didn't
> work: How do you bootstrap the initial encrypted passwords for a
> first-time installation?
>
> Obviously, the jetspeed om scripts need to have pre-encrypted
> strings as the passwords, but how should these be generated?
>
> -- 
> Gary Lawrence Murphy - garym@teledyn.com - TeleDynamics Communications
>    - blog: http://www.teledyn.com/mt/ - biz: http://teledyn.com/ -
>   "Computers are useless. They can only give you answers." (Picasso)
>
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>
>
Try this code snippet:

                 Iterator users = JetspeedSecurity.getUsers();
                 while (users.hasNext())
                 {
                     JetspeedUser user = (JetspeedUser) users.next();
                     Log.debug(this.getClass().getName()+": "+type+"ing 
password for user ["+user.getUserName()+"]");
                     String newpassword = 
JetspeedSecurity.encryptPassword(user.getPassword());
                     user.setPassword(newpassword);
                     // Save to database
                     JetspeedSecurity.saveUser(user);
                 }
             }

--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
+01 707 773-4646




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>