Share a portfolio with someone by email address. If the person does not exist, they will be created, and an email will be send notifying them of the username and password. The password is wrong. You can tell it from the email. The correct password is 8 decimal digits. Instead they get a much longer password of hex characters. THe problem is that agent.getPassword returns an encrypted password, which is of course not what you need.
The attached patch copies code from SiteAddParticipantHandler.java. It would probably be better to put guest account creation and notification in one place.