Open GoogleCodeExporter opened 9 years ago
If you code relies on UserServiceFactory.getUserService (which I'm sure 100% it
does), you cannot transparently provide a subclass of UserServiceFactory
because it is marked final.
You can however implement a CustomUserService and wrap the one returned by that
factory (including the request and response) and delegate the methods to the
wrapped service except for isUserLoggedIn() and getCurrentUser().
public boolean isUserLoggedIn() {
// checks the cached OpenIdUser from the request attribute first
return RelyingParty.getUser(request) != null || wrappedService.isUserLoggedIn();
}
public User getCurrentUser() {
OpenIdUser user = RelyingParty.getUser(request);
if(user == null)
return wrappedService.getCurrentUser();
// populate the User from the OpenIdUser
// and return that.
}
Good luck!
Original comment by david.yu...@gmail.com
on 16 Aug 2010 at 4:27
Can't find RelyingParty.getUser(request), has it been removed in the current
version?
Original comment by hatem.el...@gmail.com
on 17 Jun 2011 at 8:43
Original issue reported on code.google.com by
dominik.bartholdi@gmail.com
on 15 Aug 2010 at 5:34