[Building Sakai] Retrieving current user from session

Sam Ottenhoff ottenhoff at longsight.com
Tue Jul 22 13:51:16 PDT 2014


/**
 * Get a user's email address based on their session id
 *
 * @param   sessionid       the session id of the user who's email address
you wish to retrieve
 * @return                  the email address for the user
 * @throws  AxisFault
 *
 */
public String getUserEmailForSession( String sessionid ) throws AxisFault
{
    Session session = establishSession(sessionid);
    User user = userDirectoryService.getCurrentUser();
    return user.getEmail();
}



On Tue, Jul 22, 2014 at 4:44 PM, Sergio Muriel <sergioame at hotmail.com>
wrote:

> Dear All,
> Does anyone have a good working example of a web service in which the
> current user is retrieved from the current session?
> Please note that what I need to retrieve is an object of the class:
> org.sakaiproject.user.api.User
>
> Best Regards,
> Sergio Muriel
>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140722/663964e8/attachment.html 


More information about the sakai-dev mailing list