Hi all,
I need help, because I got a big problem with auto-create-user : I receive
the exception "javax.security.auth.login.LoginException: No such user".
*Context :
*- I use the slide login module *from a Filter before the slide Servlet*.
- I try to login with a user that doesn't exists in slide
- I've added the necessary parameters in Domain.xml to create automatically
the users
*Problem : *
When I login using the SlideLoginModule, everything seems to work fine :
- The SlideLoginModule calls SecurityImpl.getPrincipal()
- As the user doesn't exists and the auto-create-user option is set, the
user is created
- But at the end of SecurityImpl.getPrincipal(), there is a call to *
subjectUri.getStore().retrieveObject(subjectUri);*
This method calls *AbstractRDBMSStore.retrieveObject(Uri**)* with the Uri of
my newly created user ("/users/my_new_user").
The problems starts here because the call to
*getCurrentlyActiveTransactionalResource()
*return *null* and then the store create a new connection.
As this is a new connection and as my initial transaction in wich I've
created the user is not commited, the calls in *AbstractRDBMSStore.
retrieveObject(Uri**)* will not see the newly user created (but not
commited) and then an exception will be raised.
*Question : *
How do I declare my transcation ?
I've used
lc = *new* LoginContext("my_login_ctx", cbh);
NamespaceAccessToken namespace = Domain.accessNamespace(*new*
SecurityToken(""), Domain.getDefaultNamespace());
* try* {
namespace.begin();
lc.login();
namespace.commit();
}
...
Ektor