If I understood you correctly you have a custom signup controller and after successful signup the user shall be logged in.
We also had this case in a play2 java app with securesocial, and our CustomRegistrationController.handleSignUp method looks s.th. like this:
public Result handleSignUp(final String token) {
// verify token, validate form, fill user from form etc.
...
// save user in userService, delete token
userService.doSave(user);
userService.doDeleteToken(token);
// login user
final Either<Error, Authenticator> result = Authenticator.create(user);
if (result.isLeft()) {
// add some msg to flash, redirect to login
...
return redirect(RoutesHelper.login());
}
// Add the auth cookie to response
final play.api.mvc.Cookie authCookie = result.right().get().toCookie();
response().setCookie(authCookie.name(), authCookie.value(),
(Integer)Scala.orNull(authCookie.maxAge()), authCookie.path(),
Scala.orNull(authCookie.domain()), authCookie.secure(), authCookie.httpOnly());
// Add some success message
...
return redirect(routes.UserSignUpController.signUpConfirmation());
}
I hope this answers your question.