You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Carl Hall <ca...@hallwaytech.com> on 2012/05/16 21:25:00 UTC

Creating a user as anonymous (SLING-2465)

SLING-2465 outlines that when creating a user (self-registration=true) as
an anonymous user, an NPE is thrown because the anonymous user can't see
the newly created user and the User is used to set the path on the
response. In talking with Justin, I've created a patch[1] to impersonate a
session with the new user but closing the impersonated session in
createUser(..) creates a problem of using the returned User ("This session
has been closed."). Does anyone see a nice way to get around this? I can
think of some terrible hacks but no one wants that. :)

Thanks,
Carl

1 http://pastebin.com/6DMeiih0

Re: Creating a user as anonymous (SLING-2465)

Posted by Eric Norman <er...@gmail.com>.
It looks like all it needs is the path of the created user.  The created
user should always be the first Modification in the changes list so you can
probably just get the user path from there if the returned user is null.
 See patch [1].

Regards,
Eric

1. http://pastebin.com/0DX4i8fK

On Wed, May 16, 2012 at 12:25 PM, Carl Hall <ca...@hallwaytech.com> wrote:

> SLING-2465 outlines that when creating a user (self-registration=true) as
> an anonymous user, an NPE is thrown because the anonymous user can't see
> the newly created user and the User is used to set the path on the
> response. In talking with Justin, I've created a patch[1] to impersonate a
> session with the new user but closing the impersonated session in
> createUser(..) creates a problem of using the returned User ("This session
> has been closed."). Does anyone see a nice way to get around this? I can
> think of some terrible hacks but no one wants that. :)
>
> Thanks,
> Carl
>
> 1 http://pastebin.com/6DMeiih0
>