[Building Sakai] Login in to Sakai via code

David Horwitz david.horwitz at uct.ac.za
Thu May 20 05:42:00 PDT 2010


Hi All,

I'm working on a RSF tool to validate new guest accounts. The user will
receive a token and and go to the tool to validate the account. At the
end of the workflow they should be logged into the sakai portal. Now
looking at the code in login tool I have the following which looks like
it should work but leaves the user on the portal, unauthenticated:


//log the user in
            Evidence e = new IdPwEvidence(vc.getUserEid(),
vc.getPassword1());
            try {
                Authentication a = authenticationManager.authenticate(e);
                log.info("authenticated " + a.getEid() + "(" +
a.getUid() + ")");
                log.info("reg: " + httpServletRequest.getRemoteAddr());
                log.info("user agent: " +
httpServletRequest.getHeader("user-agent"));
                if (usageSessionService.login(a, httpServletRequest)) {
                    log.info("logged in!");
                }
               
               
                return "success";
            } catch (AuthenticationException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }


any ideas?

Thanks

David


More information about the sakai-dev mailing list